How to get that day before seren days of today!

My English is poor! I have a problem!How to get that day before seren days of today,and coveren(change) to string varilble. quest that because I need make this SQL.select * from table1 where theday=today-7
[233 byte] By [yukinglie] at [2007-9-26 1:44:56]
# 1
Can you help!
yukinglie at 2007-6-29 2:40:52 > top of Java-index,Archived Forums,Java Programming...
# 2
SQL != JavaKirk
kswoll at 2007-6-29 2:40:52 > top of Java-index,Archived Forums,Java Programming...
# 3

in oracle this should work:

select * from table1 where trunc(theday)=trunc(sysdate-7 )

but I believe its database dependent.

sysdate is the current date + time

trunc if applied to a date sets the time to 0:00:00

HTH

Spieler

PS: Do not crosspost ... sql question if you have to post

them on jdc belong in the jdbc forum

spieler at 2007-6-29 2:40:52 > top of Java-index,Archived Forums,Java Programming...