TheWizardofInt Posted March 22, 2004 Posted March 22, 2004 I am using this code: Dim sSQL As String = "Select Contact1.Contact, " & _ "Contact1.RecID FROM Contact1, Cal WHERE " & _ "AlarmDate=" & Today & " AND convert" & _ "(varchar(8),AlarmTime,113)>=convert(varchar,'" & _ Format(Now, "HH:mm") & "',113) AND AlarmFlag='Y'" To compare a string field with a time value in it to a time value, in order to return the rows where a date and time has passed now and an alarm flag is set I know I am misusing the VarChar but I don't see how - any help with a correct line here? Thanks Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Administrators PlausiblyDamp Posted March 23, 2004 Administrators Posted March 23, 2004 in the snippet =convert(varchar,'" & _ Format(Now, "HH:mm") & "',113) you need to specify the size of the varchar i.e. varchar(10) - similar to what you did earlier. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
TheWizardofInt Posted March 24, 2004 Author Posted March 24, 2004 Actually, it turned out that I needed to use 114, not 113 Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.