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 > Database Server Software > MySQL > Invalid operator for data type

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-18-04, 01:56
EuropePT EuropePT is offline
Registered User
 
Join Date: May 2004
Posts: 5
Question Invalid operator for data type

Hi
I am getting the following error message when I try to put the datetime between strings

Invalid operator for data type. Operator equals boolean AND, type equals datetime.


The code is:

INSERT INTO AdminAlerts values (CURRENT_USER, 'INSERT', getDate(), @biui, 'Booked room number ' & @rn & ' on ' & @gd & ', Customer ID: ' & @ci & ' and Booking ID: ' & @biui)

@gd is where the error is, it is a datetime.
Anyone knows whats wrong?
Reply With Quote
  #2 (permalink)  
Old 05-18-04, 09:43
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
The word INSERT is a reserved word, yet you are using it within your insert statement itself, likely this is causing the error.
Reply With Quote
  #3 (permalink)  
Old 05-18-04, 09:49
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
Assuming that your INSERT is intended to run in MySQL instead of another tool such as MS-Access, I think you want to use the Concat() function instead of the & operator.

-PatP
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