PDA

View Full Version : date difference


ebco
10-04-2004, 03:50 PM
select * from mytable where date = '20040402'

what if i want the record for one from the given date how to get the next months date

i.e. 20040502

fractalvibes
10-04-2004, 05:08 PM
Use the DateAdd function

fv

glenngv
10-05-2004, 02:29 AM
The date field must be of datetime type or if varchar, it must be of recognizable date format (2004/04/02 and not 20040402) so that you can CAST or CONVERT it to datetime.

ebco
10-05-2004, 10:11 AM
thanks


it is working with DateAdd function