Hello all. I need your help please.
I have a MSSql2000 table with a column named last_update with the datetime format.
I am trying to query only the date portion of the data to verify that an entry for a specific day does not exist before inserting a new record. I am not having much luck or finding what I need online.
Here is the code I am trying to use in Access to return the MSSql2000 data:
date_one = [Forms]![frm_oven]![date_one] 'date time pick box on Access form
date1 = Format(date_one, "yyyy-mm-dd") 'date format same as MSSql2000 column
SQLa = "SELECT Temperature FROM Ovens where last_update = '" & date1 & "'"
Set rs = cn.Execute(SQLa, , adCmdText)
If rs.eof = true then 'insert new oven data
Else: MsgBox"Existing data present.": Exit Sub
End If
Thank you for any and all help.
I have a MSSql2000 table with a column named last_update with the datetime format.
I am trying to query only the date portion of the data to verify that an entry for a specific day does not exist before inserting a new record. I am not having much luck or finding what I need online.
Here is the code I am trying to use in Access to return the MSSql2000 data:
date_one = [Forms]![frm_oven]![date_one] 'date time pick box on Access form
date1 = Format(date_one, "yyyy-mm-dd") 'date format same as MSSql2000 column
SQLa = "SELECT Temperature FROM Ovens where last_update = '" & date1 & "'"
Set rs = cn.Execute(SQLa, , adCmdText)
If rs.eof = true then 'insert new oven data
Else: MsgBox"Existing data present.": Exit Sub
End If
Thank you for any and all help.