Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    5

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

    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

  2. #2
    Join Date
    May 2004
    Posts
    5
    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?

  3. #3
    Join Date
    Feb 2004
    Location
    Poland
    Posts
    32
    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.
    Last edited by MST78; 05-18-04 at 06:04.

  4. #4
    Join Date
    May 2004
    Posts
    5
    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •