If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > New Members & Introductions > Syntax error (missing operator) in query expression '23/04/2010 23:37:00'.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-23-10, 10:00
Tony Peters Tony Peters is offline
Registered User
 
Join Date: Apr 2010
Posts: 4
Red face Syntax error (missing operator) in query expression '23/04/2010 23:37:00'.

Hi everyone, I need some HEEELLLPPP
I get the above error when I try to run the qrySQL2 query.
What I want to do is: if the date from the TimeCalled field is the same as the date in the TimeOut field then compare that the time from TimeOut is later than the time from the TimeCalled field.
If the date in the TimeOut field is later than the date from the TimeCalled field then do not compare the times.
Both TimeCalled and TimeOut are Date/Time fields and the format is set to General Date.

If anyone can help me it would be greatly appreciated.


Dim qrySQL1 As String
Dim qrySQL2 As String
Dim newValue1 As String
Dim dateTimeOut As Date


If IsNull(TimeOut) Then 'Vehicle is available
newValue1 = "-1"
Else
newValue1 = "0" 'Vehicle is not available
dateTimeOut = Format(Now(), "dd/mm/yyyy ") + Format(TimeOut)
qrySQL1 = "UPDATE tblAppliances SET IsAvailable=" + newValue1 + " WHERE ID=" + Format(Appliance.Value)
qrySQL2 = "UPDATE tblResponse SET TimeOut=" + Format(dateTimeOut) + " Where ID=" + Format(Me.ID)
DoCmd****nSQL (qrySQL1)
DoCmd****nSQL (qrySQL2)

End If


If Date1BeforeDate2(TimeOut, TimeCalled) Then
Exit Sub
End If

If (TimeOut) < (TimeCalled) Then
MsgBox "The TIME OUT is earlier than the TIME CALLED " & vbNewLine & " " & _
vbCrLf & "Please enter the Correct Time. ", vbOKOnly, " Incorrect Time Entered "
Cancel = True
TimeOut.SelStart = 0
TimeOut.SelLength = Len(TimeOut.Text)
End If

Last edited by Tony Peters; 04-23-10 at 10:09.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On