chasbrouck
Programmer
Hello,
I am trying to execute a query that gets a date from a user form and compares it against a field in my Database. The trouble is that the field in the database is a text field containing a date and a time in the following format: mm/dd/yyyy-hh:mm AM
I can not change this field to be a date or date time field, so I need to look at only the first 10 characters for my comparison. Below are two versions of the query I have tried with out sucess. Any help would be gratly appreciated.
Thanks,
Chris Hasbrouck
Software Developer
Bassett Healthcare
******************************************
Select PropertyControlNO, Description, ManufacturerID, ProductType, Dept, Name, EntryDate, EntryID, DeleteID, SUBSTRING('DeleteDate' FROM 1 FOR 10) as DDATE
From deleted
Where DDATE > DateValue('#Form.Date#')
Order by PropertyControlNO
*******************************************
Select PropertyControlNO, Description, ManufacturerID, ProductType, Dept, Name, EntryDate, EntryID, DeleteID, DeleteDate
From deleted
Where SUBSTRING('DeleteDate' FROM 1 FOR 10) > DateValue('#Form.Date#')
Order by PropertyControlNO
I am trying to execute a query that gets a date from a user form and compares it against a field in my Database. The trouble is that the field in the database is a text field containing a date and a time in the following format: mm/dd/yyyy-hh:mm AM
I can not change this field to be a date or date time field, so I need to look at only the first 10 characters for my comparison. Below are two versions of the query I have tried with out sucess. Any help would be gratly appreciated.
Thanks,
Chris Hasbrouck
Software Developer
Bassett Healthcare
******************************************
Select PropertyControlNO, Description, ManufacturerID, ProductType, Dept, Name, EntryDate, EntryID, DeleteID, SUBSTRING('DeleteDate' FROM 1 FOR 10) as DDATE
From deleted
Where DDATE > DateValue('#Form.Date#')
Order by PropertyControlNO
*******************************************
Select PropertyControlNO, Description, ManufacturerID, ProductType, Dept, Name, EntryDate, EntryID, DeleteID, DeleteDate
From deleted
Where SUBSTRING('DeleteDate' FROM 1 FOR 10) > DateValue('#Form.Date#')
Order by PropertyControlNO