I am facing a simple problem. I have always worked with MS SQL and MySQL, this is my first time with SQLite. I want to fetch data from the following table where the month from the date column is equal to the one provided.
RecNo feesId memberId feesAmount feesReceipt feesDate feesPaidTillMonth feesPaidTillYear
----- ------ -------- ---------- ----------- ---------- ----------------- ----------------
1 1 15 10.00 fsadfdsf 2013-08-10 11 2013
2 2 5 100.00 122314 2013-08-10 3 2015
3 3 13 444.00 sda 2013-08-10 1 2013
4 4 5 66.50 5564 2013-08-10 11 2013
I want to get all the rows 'WHERE month(feesDate) = 08'
I know the month function is not of SQLite but I want to do the similar thing here. I searched Google and I got this:
strftime('%m',[memberFees].[feesDate])
but it does not do the stuff I want. The whole Query where I want this function is this:
SELECT [memberList].[memberId],[memberList].[memberFName], [memberList].[memberLName],
[memberFees].[feesAmount],[memberFees].[feesDate],[memberFees].[feesPaidTillMonth],[memberFees].[feesPaidTillMonth]
FROM [memberFees] INNER JOIN [memberList] on [memberfees].[memberId] = [memberList].[memberId]
WHERE
strftime('%m',[memberFees].[feesDate]) = 8 AND [memberList].[memberLevel] = 3
SQLite的%m
格式的strftime()
函数返回前导零的月份:
strftime('%m',[memberFees].[feesDate]) = '08'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.