Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with query on date stored as sring
Message
General information
Forum:
Internet
Category:
Active Server Page
Miscellaneous
Thread ID:
01393644
Message ID:
01393651
Views:
31
Assuming mDate = 14/11/2009

Select field1, field2, mDate from myTable where date(val(substr(mDate,7,4)),val(substr(mDate,4,2)),val(left(mDate,2))) >=date()-7

Not Rushmore optimizable

>the data is in a vfp table, c(20) field. i need to query that field returning only those with a date after 7 days ago. the dates are in british format. I am using vb script in an asp page.
>~M
>>
>>Are you using VFP data? Perhaps you can run a script using EXECSRCIPT and in this script first set date to British (or any DMY format).
>>
>>In SQL Server you would use SET SYSFORMAT to DMY for this.
>
>>>hi all,
>>>we have a legacy app written in asp and it is not possible to update it to asp.net. at the moment it stores multiple dates as strings in the format 14/11/2008 for the 14th of November 2008. what i need to do is select out the last weeks transactions based on that date. I have a variable of mdate which is date() - 7 which is fine but trying cdate() on the field in the table doesn't work. any ideas?
>>>~M
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform