|
-
September 2nd, 2001, 07:33 PM
#1
GETDATE()
i have a database program and i need to print a query when a certain time lasp has accurd in a date length...
i creadted a search query and in the required field i put in the criteria of
from (orderdate >= DATEADD(day, -5, GAETDATE()))
when i run the query i get and error
undefined function 'getdate' in expression
also after i create this and get it working how do you run a query from a command button..
midnightservice
thanx in advance
-
September 2nd, 2001, 07:39 PM
#2
Re: GETDATE()
Did you include the header for it? Or did you place a prototype for the function GETDATE() (or put the function above the main() function) above main()?
That's all I think of (and if you made GETDATE(), make sure you add the .cpp file to the Project).
-
September 2nd, 2001, 07:48 PM
#3
Re: GETDATE()
well picky this is VB 6.0 not c++ so no header or main to plac it in....
thanks anyway
midnightservice
-
September 3rd, 2001, 11:06 AM
#4
Re: GETDATE()
Hi, if this query in VB then use the 'now()' function.
-
September 3rd, 2001, 12:27 PM
#5
Re: GETDATE()
okay i used the now() function like this
<={fn NOW()}
but it istll will not go back 5 days...it will generate a report for the day before this and back but i wont it to start 5 days before the current date..
midnightservice
-
September 3rd, 2001, 12:57 PM
#6
Re: GETDATE()
Why don't you try DateDiff()function.
Eddie
-
September 3rd, 2001, 12:59 PM
#7
Re: GETDATE()
okay i got it ty......new function
<={fn NOW()-5}
okay now i have one more question i made a 2 querys...
1. insert query
2. delete query
to move info from one table to another
how do i execute the querys....i have tried to load them from the load and excute commands but what i want is when they close a form the queery is automatically ran and completed and then the program shuts off... any ideas....
midnightservice
-
September 4th, 2001, 04:17 AM
#8
Form_QueryUnload Event
I don't quite know what you mean, but the QueryUnload event may do the trick. It gets run before the Form_Unload event and would probably be the most suitable place for the code to run the action queries you want.
HTH ... if I'm off the point mail me your requirement, I'll try have a look.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|