最新黄网在线观看_丁香一区二区三区_国产精品视区_国内高清免费在线视频

查詢(xún)篇-查詢(xún)顧問(wèn)產(chǎn)出(即正式學(xué)員交費(fèi)金額)

2013年08月02日 10:11
點(diǎn)擊率:10308

主查詢(xún):
Select
Student.ConsultantName as 顧問(wèn),
sum(Payment.PayMoney) as 金額,
Student.ConsultantID as ShowKey
from Payment,Student
where Payment.StudentID = Student.StudentID
and Payment.DateAndTime >= {@StartDate:開(kāi)始日期}
and Payment.DateAndTime <= {@EndDate:結(jié)束日期}
and Payment.PaymentTypeID in (1,2)
group by Student.ConsultantID , Student.ConsultantName

子查詢(xún):
Select
Bill.StudentName as 所屬學(xué)員姓名,
Bill.DateAndTime as 消費(fèi)日期,
Bill.BillTypeID as 類(lèi)型,
Bill.Pay as 應(yīng)收金額,
Bill.Favourable as 優(yōu)惠金額,
Bill.Payed as 實(shí)收金額,
BillItem.ProductName as 收費(fèi)項(xiàng)名稱(chēng)
from Bill,billitem,Student
Where bill.billid=billitem.billid
and Bill.StudentID = Student.StudentID
and Bill.DateAndTime >= {@StartDate}
and Bill.DateAndTime <= {@EndDate}
and Student.ConsultantID = {@ShowKey}

這個(gè)查詢(xún)?cè)谥鞑樵?xún)?cè)O(shè)計(jì)上,參考Payment充值表流水,達(dá)到精準(zhǔn)目的。 但在明細(xì)上調(diào)用的是消費(fèi)單信息,實(shí)現(xiàn)交費(fèi)的用途查詢(xún)。如果學(xué)員存在預(yù)充值(充值尚未進(jìn)行消費(fèi)),或者退學(xué)等,明細(xì)里不作反映。



(把以上代碼粘貼到《麥田培訓(xùn)學(xué)校管理軟件》查詢(xún)管理里,可直接使用)
主站蜘蛛池模板: 克山县| 太仓市| 清远市| 吕梁市| 崇明县| 静宁县| 白山市| 鹰潭市| 肃宁县| 天峨县| 浦江县| 读书| 龙口市| 宁津县| 连州市| 原阳县| 翁牛特旗| 灵川县| 屏南县| 沙河市| 桐乡市| 东乡县| 临泽县| 科技| 金湖县| 海门市| 偃师市| 乐至县| 突泉县| 武功县| 和平区| 延庆县| 平顺县| 武汉市| 兴化市| 灌阳县| 荔浦县| 静宁县| 五常市| 江阴市| 贡觉县|