SQL Comparison and Action

Started by
2 comments, last by TheKoolGuy 20 years ago
Ok, i''m really sorry if this has popped up before but i gota hand in my coursework using a bit of SQL tomorrow!!! :''( I am using Access 2000 format and as part of an automated macro/query I need to compare a certain table called [Date of Booking] to see if it''s more than the current time Now(). If this is true, i then need it to Copy some record fields from one table [Booking] to another [Invoice], and if it''s not true, just keep repeating. Can anyone help? I know it doesn''t work but the following kinda shows how i''d like it to work and u''d know what i mean when you read it: INSERT INTO Invoice ([Car Registration],[Date]) VALUES (Booking.[Car Registration], Now()) WHERE Booking.[Date of Booking] >= Now() Cheers for any help.
----------------------------It Shall Be Done!!!
Advertisement
You need a SELECT statement in there somewhere....
Since this is homework, you can figure out where.
lol, not homework, CourseWork with a deadline for tomorrow and we don''t get marks for our SQL so i''d love some help ASAP plz lol.
----------------------------It Shall Be Done!!!
Statement has to be changed to something like:

INSERT INTO Invoice ([Car Registration],[Date])
SELECT Booking.[Car Registration], Now()
WHERE Booking.[Date of Booking] >= Now()

Cheers.
Brendan.

This topic is closed to new replies.

Advertisement