Monday, March 26, 2012

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

I am getting a error message saying: Invalid operator for data type. Operator equals boolean AND, type equals datetime.

I traced the pointer to @.gdo and @.gd, they are both dates!

INSERT INTO AdminAlerts values (CURRENT_USER, 'UPDATE', getDate(), @.biui, 'Updated booking, ID of booking updated: ' & @.biui & ', Booking date and time before/after update: ' & @.gdo & '/' & @.gd & ', Room number before/after update: ' & @.rno & '/' & @.rn & ' and Customer ID before/after update: ' & @.cio & '/' & @.ci)

If I cut that two dates out it works fine.
Could someone tell me the syntax to include a date in a string :confused:Another trouble, Now I also figure even I cancel the date variable out, I also get the Syntax error trying to convert varchar 'blah blah blah' into an int column.

INSERT INTO AdminAlerts values (CURRENT_USER, 'UPDATE', getDate(), @.biui, 'Updated booking, ID of booking updated: ' & @.biui & ', Booking date and time before/after update: ' & @.gdo & '/' & @.gd & ', Room number before/after update: ' & @.rno & '/' & @.rn & ' and Customer ID before/after update: ' & @.cio & '/' & @.ci)

I means the & @.biui & between Strings. @.biui, @.rno, @.rn are all int

Can someone give me some help pls?|||If I see it right you want to convert date and int into string. Try CAST or CONVERT, and use '+' to concatenate strings instead of '&' which is bitwise AND operation.|||Thanks!
It Works great!!

I have created a procedure which display all the record in a table.
How can I execute that in Access please? (I mean show the table in access)sql

No comments:

Post a Comment