Hi all
I am trying to select between two dates in a sql table. This is the following statement that I am using:
where todate and fromdate are both strings. I am getting the error message cannot convert from a char to a datetime.
Can anyone tell me how this should be done?
Mike55.
I am trying to select between two dates in a sql table. This is the following statement that I am using:
Code:
sqlCmd.CommandText = "SELECT Count(ID) FROM SentMessages WHERE Org_ID = " & orgID _
& " AND (Msg_Type = SMS OR Msg_Type = MO OR Msg_Type = WAP) AND (MessageDate BETWEEN " & Convert.todatetime(fromDate) & " AND " & convert.todatetime(toDate) & ")"
Can anyone tell me how this should be done?
Mike55.