General information
Category:
Coding, syntax & commands
Since you have 2 sepearate criterias you are going to ahve to use 2 seperate INSERT statements. Your first statement will consist of an INSERT where the departure date is 1 day greater then the arrival date. The 2nd statement would be INSERT where the departure date is 2 days greater then the arrival date. It's hard for me to write code without knowing your tables but hopefully the example below shows it:
INSERT INTO NewTable SELECT Count(CustomerID) as CountOf1DayAfter FROM OriginalTable WHERE (DepartureDate - ArrivalDate) = 1
INSERT INTO NewTable SELECT Count(CustomerID) as CountOf2DaysAfter FROM OriginalTable WHERE (DepartureDate - ArrivalDate) = 2
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only