Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15458

SQLite & RC 5 query for month and year

$
0
0
Hello Vbforums
I'm using SQLite & Vbrichclient I need to query for records for curent month and year.
This is what I did but without success.
For curent month
Code:

strSQL = "Select *  from Transac_tbl where MyDate between " & DateSerial(Year(Date), Month(Date), 1) & " and  " & DateSerial(Year(Date), Month(Date) + 1, 0)
StrSql = "Select *  from Transac_tbl where strftime('%Y %m' , MyDate) between  " & DateSerial(Year(Date), Month(Date), 1) & " and  " & DateSerial(Year(Date), Month(Date) + 1, 0)

For curent year
Code:

StrSql = "Select * from Transac_tbl where strftime('%Y',MyDate)= '" & Format(Year(Date), "yyyy")) & "')"
thank you in advance

Viewing all articles
Browse latest Browse all 15458

Latest Images

Trending Articles



Latest Images