Hi all- I'm creating an update query.
I have a field [dateLastEdit] that is stored as text, I have to compare it to a date entered on a form by user [date_from] (I need to select all dates greater than this) but I'm running into problems:
when I use date_from in text or date format and compare it to dateLastEdit in text format the comparison is made in numeric order(so 12/02/2006 is selected as well as 12/02/2005 when date_from is 12/01/2006)
when I use date_from in date format and compare it to dateLastEdit converted to date format I get "expression typed incorrectly or it is too complex to be evaluated" msg.
[LastEditDate]'s format is always mm/dd/yyyy hh:mm:ss, but as text, not date data type.
I've tried CDate with same results, isolating it in its own query to test it, using hardwired dates as criteria, but no joy, am I missing something obvious?
forgot to add- I've used all the above with left also to select only date portion with same results
I have a field [dateLastEdit] that is stored as text, I have to compare it to a date entered on a form by user [date_from] (I need to select all dates greater than this) but I'm running into problems:
when I use date_from in text or date format and compare it to dateLastEdit in text format the comparison is made in numeric order(so 12/02/2006 is selected as well as 12/02/2005 when date_from is 12/01/2006)
Code:
SELECT PTSData.LastEditDate
FROM PTSData
WHERE (((PTSData.LastEditDate)>=[Forms]![chMgmt_frm]![date_from]));
Code:
SELECT DateValue([LastEditDate]) AS Expr1
FROM PTSData
WHERE (((DateValue([LastEditDate]))>=[Forms]![chMgmt_frm]![date_from]));
I've tried CDate with same results, isolating it in its own query to test it, using hardwired dates as criteria, but no joy, am I missing something obvious?
forgot to add- I've used all the above with left also to select only date portion with same results