-
Hi, every body!
I'm trying to use a dateadd expression in a SQL statment, but I'm having problems cause this function calls for a parameter between double quotes:
eg.
dateadd("d", 1, date)
My SQL is full of dateadd functions (I've brought this SQL from Access, and it works pretty well there)
Any ideas on how could I get it to work in VB?
I'll post here a little bit of my SQL, just as an example of what my problem is:
Set Myset = MyDb.OpenRecordset("SELECT Calibrations.RealDate, Last(IIf(Weekday(IIf([Unit]=1,DateAdd("d",[Value],[RealDate]),IIf([Unit]=2,DateAdd("m",[Value],[RealDate]),IIf([Unit]=3,DateAdd("m",[Value]*12,[RealDate]),"time unexpected")))) _ and so on...
Thanks in advance for any ideas,
Roselene
-
I believa data types should allways be between #'s like:
SQL = "SELECT * WHERE date =#" & date & "#;"
Hope this helps,
------------------
Jorge Ledo
[email protected]
Portugal
[This message has been edited by JorgeLedo (edited 02-15-2000).]