Oct 10, 2002 #1 Benouche Programmer Aug 6, 2002 48 FR Hello, Is there any way to get the current date (in date format if possible ...) in a sql script. Could come from any sure place (DB, Server ...) I need this for filtering datas ! Thanks a lot, Benouche
Hello, Is there any way to get the current date (in date format if possible ...) in a sql script. Could come from any sure place (DB, Server ...) I need this for filtering datas ! Thanks a lot, Benouche
Oct 10, 2002 #2 fluteplr Programmer Oct 23, 2000 1,599 US Depends on your database. For example in sql server it is select getdate() Upvote 0 Downvote
Oct 10, 2002 #3 petersJazz Programmer Jan 28, 2002 222 EU And in standard SQL it would be CURRENT_DATE like in: 1. select id, name from table where reg_date = current_date; 2. select id from table where regdate > current_date - interval '20' day(5); Upvote 0 Downvote
And in standard SQL it would be CURRENT_DATE like in: 1. select id, name from table where reg_date = current_date; 2. select id from table where regdate > current_date - interval '20' day(5);
Oct 10, 2002 Thread starter #4 Benouche Programmer Aug 6, 2002 48 FR my server is Oracle 8i ... Upvote 0 Downvote
Oct 11, 2002 #5 petersJazz Programmer Jan 28, 2002 222 EU In Oracle its sysdate, like in select * from transactions where transdate > sysdate - 7; gets all transactions for the last seven days. Upvote 0 Downvote
In Oracle its sysdate, like in select * from transactions where transdate > sysdate - 7; gets all transactions for the last seven days.
Oct 11, 2002 Thread starter #6 Benouche Programmer Aug 6, 2002 48 FR Hi PetersJazz, If i write the command sysdate in sqlplus, I get an error msg 'Unknown command' In the same time I was looking for it on Internet and I get the same answer > sysdate I get confused ... Any idea ? Upvote 0 Downvote
Hi PetersJazz, If i write the command sysdate in sqlplus, I get an error msg 'Unknown command' In the same time I was looking for it on Internet and I get the same answer > sysdate I get confused ... Any idea ?
Oct 11, 2002 Thread starter #7 Benouche Programmer Aug 6, 2002 48 FR ok thanks everybody, Jazzateers and others, I understood finally .. I'm new to dbs.... Upvote 0 Downvote