erikayperry
New Member
- Joined
- Aug 12, 2015
- Messages
- 11
Hello,
I have the SQl script below. It currently runs off me entering the date. However, I now want to be able to enter a number in the parameter box instead. For instance, If I enter 123 I want to see all the times 123 came along with what came 2 days before and 1 day after.
Example: 2/1/2016 ----123
1/31/2016----234
1/30/2016----456
2/2/2016-----555
This is my script below.
PARAMETERS [Enter Date:] DateTime, [Enter YourNumber:] IEEEDouble;
SELECT "YourTable" AS SourceTable, YourDate, YourNumber
FROM YourTable
WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
UNION ALL
SELECT "Cash4Table", YourDate, YourNumber
FROM Cash4Table
WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
UNION ALL
SELECT "Fantasy5Table", yourDate, YourNumber
FROM Fantasy5Table
WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
UNION ALL
SELECT "GAFiveTable", YourDate, YourNumber
FROM GAFiveTable
WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
UNION ALL SELECT "MoonPhaseTable", YourDate, YourNumber
FROM MoonPhaseTable
WHERE YourDate BETWEEN [Enter Date:]-4 AND [Enter Date:]+1
ORDER BY SourceTable, YourDate;
I have the SQl script below. It currently runs off me entering the date. However, I now want to be able to enter a number in the parameter box instead. For instance, If I enter 123 I want to see all the times 123 came along with what came 2 days before and 1 day after.
Example: 2/1/2016 ----123
1/31/2016----234
1/30/2016----456
2/2/2016-----555
This is my script below.
PARAMETERS [Enter Date:] DateTime, [Enter YourNumber:] IEEEDouble;
SELECT "YourTable" AS SourceTable, YourDate, YourNumber
FROM YourTable
WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
UNION ALL
SELECT "Cash4Table", YourDate, YourNumber
FROM Cash4Table
WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
UNION ALL
SELECT "Fantasy5Table", yourDate, YourNumber
FROM Fantasy5Table
WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
UNION ALL
SELECT "GAFiveTable", YourDate, YourNumber
FROM GAFiveTable
WHERE YourDate BETWEEN [Enter Date:]-1 AND [Enter Date:]+1
UNION ALL SELECT "MoonPhaseTable", YourDate, YourNumber
FROM MoonPhaseTable
WHERE YourDate BETWEEN [Enter Date:]-4 AND [Enter Date:]+1
ORDER BY SourceTable, YourDate;