|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
date difference
Hi,
I have a date stored in a database which I want to use against the system date and only display those records in the database which are older than 6 months old. Or would it be easier to allow the select statement to do this filtering. What would the where clause look like? Any ideas would be very helpful. regards peter |
|
#2
|
|||
|
|||
|
Yes do it in the WHERE clause. It might be as easy as:
select * from mytable where pubDate > ( trunc( sysdate ) - 90 ) should get anything with a pubDate in the last 90 days (in an Oracle database). But each database is different so you'll have to dig around.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
if it's Access, then you could do this
Where someDate BETWEEN DateAdd('m', -6, date()) AND date() |
|
#4
|
|||
|
|||
|
Ms Sql
I'm doing it MS Sql.
Really just need the where clause. Thanks for all your help. Great site |
|
#5
|
|||
|
|||
|
I'd ask in the MySQL forum.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > date difference |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|