Hi All,
I have the following queries (both are for same purpose) which fetches records greater the the datetime column.
SELECT PROSPECT.BUSINESS_UNIT,PROSPECT.LAST_CHANGED FROM PROSPECT WHERE (TO_CHAR(LAST_CHANGED, 'YYYY-MM-DD HH24:MI:SS') > (SELECT TO_CHAR(LAST_UPDATED, 'YYYY-MM-DD HH24:MI:SS') FROM LAST_UPDATE))
SELECT PROSPECT.BUSINESS_UNIT,PROSPECT.LAST_CHANGED FROM PROSPECT WHERE LAST_CHANGED > (SELECT LAST_UPDATED FROM LAST_UPDATE))
This query works fine in query window and also in the windows console application. But the same query does not work from c# Application. Could any one has any idea why this behaves differently in c# windows service application.
Regards
Venkatesh G
Loading
Deepak VermaPosted May 24, 2012, 4:29 AM
In both of queries, you are comparing a column with multiple values (returned by select query). It is not allowed. Second thing, You don't need to convert DATETIME to any other type for comparison. Check for you query in 'Query Window', it must be different.
venkatesh gPosted May 24, 2012, 5:54 AM
Thanks again
Regards
venkatesh g