Im Using vb.net & msacces.
wt i want to upload data in Datgridview.
Code:
select * from Table name where KtDate<Date
How can i select that data which is two months back of current date
Printable View
Im Using vb.net & msacces.
wt i want to upload data in Datgridview.
Code:
select * from Table name where KtDate<Date
How can i select that data which is two months back of current date
select * from Table name where KtDate< #DateAdd(mm,-2,Date())#
It is not working .
That doesn't tell us much... is there an error message? (if so, what?) does it return the wrong data? something else?
I can see that Gary made a minor mistake, the # characters shouldn't be there. You may also need to change mm to "m"
I m pasting this code < DateAdd(m,-2,Date())
should there any changes in given code. I Tried MSDN help & other also but nothing happens
But it is giving following error.
No value given for one or more required parameters
The quote characters are important (note that you can use either " or ' ).
It is not working.
"select * from tableName where ColumnName<DateAdd(m,-2,Date())"
Code:"select * from tableName where ColumnName<DateAdd('m',-2,Date())"
Thanks.. It is working.