• Advertisement

Archived

This topic is now archived and is closed to further replies.

SQL Comparison and Action

This topic is 5037 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
You need a SELECT statement in there somewhere....
Since this is homework, you can figure out where.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement