cancel
Showing results for 
Search instead for 
Did you mean: 

CDate equivalent in SQL (help)

Former Member
0 Kudos

Post Author: ksatria

CA Forum: Data Connectivity and SQL

I have a report in access and using the following query:IIf(CDate(&#91;MeetingStart&#93;)<#12/30/1899 8:0:0# And CDate(&#91;MeetingEnd&#93;)>#12/30/1899 7:0:0#,"X","") AS am7I believe that it should compare the time. I had transfer it to sql query as:CASE WHEN adm.Sections.MeetingStart < '#12/30/1899 8:0:0#' AND adm.Sections.MeetingEnd > '#12/30/1899 7:0:0#' THEN 'X' ELSE '' END AS am7However, it found out that i does not compare it properly. I wonder if anybody know what i did wrong in this query. What will be the equivalent of CDate? and am i correct with this '#12/30/1899 8:0:0#' in sql?The MeetingStart data type is varchar and the time was written as 7am. I really appreciate your help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Post Author: yangster

CA Forum: Data Connectivity and SQL

What database are you working off of?and your formula is just comparing 2 string fields so obviously its not going to behave the way you are expecting.