N
Nurse Nancy
I have a Marketing Campaign Table.
Users a fill out a profile for each new campaign that is being booked for an
advertiser.
The campaign will have
start date
number of weeks
and then I calculate the end date.
i am going to need to calucate the individual week start dates till the
campaign is over to be used for billing, invoicing and many other queries and
reports.
Where should i be doing this, and where should i store these dates?
I thought I would calculate the week start dates based on adding 7, 14, 21,
ect to the campaign start date and diaplaying them on the maintain campaign
form (unbound) but i am not sure
So on the form, I have Campaing ID, Flight Start date, Calc End Date, Number
of Weeks,
WEEK 1 thru WEEK 6 start dates (bc 6 weeks is the max)
How do i only display the Week Number Start Date if it is less than the
Calculated End Date,, since these fields are all expressions in the same
query
If it is greater than the calculated end date,, then i want it to be null on
the form.
i am not sure i should be doing this in the underlying Query, or in the form
heres my sql
SELECT [CAMPAIGN PRODUCT TABLE].[Campaign ID], [CAMPAIGN PRODUCT
TABLE].[Customer ID], [CAMPAIGN PRODUCT TABLE].ProductName, [CAMPAIGN PRODUCT
TABLE].[Product Category ID], [CAMPAIGN PRODUCT TABLE].[Target Audience ID],
[CAMPAIGN PRODUCT TABLE].[Market Region ID], [CAMPAIGN PRODUCT TABLE].[Market
ID], [CAMPAIGN PRODUCT TABLE].[Flight Start Date], [CAMPAIGN PRODUCT
TABLE].[Flight End Date], [CAMPAIGN PRODUCT TABLE].[Number of Weeks], [Flight
Start Date]+([Number of Weeks]*7) AS [Calc End Date], PRODUCTS
TABLE].[Products ID], [CAMPAIGN PRODUCT TABLE].[Disc Markup Rate], [Flight
Start Date]+7 AS [Week 2], [Flight Start Date]+14 AS [Week 3], [Flight Start
Date]+21 AS [Week 4], [Flight Start Date]+28 AS [Week 5], [Flight Start
Date]+35 AS [Week 6]
FROM ([PRODUCT CATEGORY TABLE] INNER JOIN [CAMPAIGN PRODUCT TABLE] ON
[PRODUCT CATEGORY TABLE].[Product Category ID] = [CAMPAIGN PRODUCT
TABLE].[Product Category ID]) INNER JOIN [PRODUCTS TABLE] ON [CAMPAIGN
PRODUCT TABLE].ProductName = [PRODUCTS TABLE].ProductName
ORDER BY [CAMPAIGN PRODUCT TABLE].[Customer ID], [CAMPAIGN PRODUCT
TABLE].ProductName;
Users a fill out a profile for each new campaign that is being booked for an
advertiser.
The campaign will have
start date
number of weeks
and then I calculate the end date.
i am going to need to calucate the individual week start dates till the
campaign is over to be used for billing, invoicing and many other queries and
reports.
Where should i be doing this, and where should i store these dates?
I thought I would calculate the week start dates based on adding 7, 14, 21,
ect to the campaign start date and diaplaying them on the maintain campaign
form (unbound) but i am not sure
So on the form, I have Campaing ID, Flight Start date, Calc End Date, Number
of Weeks,
WEEK 1 thru WEEK 6 start dates (bc 6 weeks is the max)
How do i only display the Week Number Start Date if it is less than the
Calculated End Date,, since these fields are all expressions in the same
query
If it is greater than the calculated end date,, then i want it to be null on
the form.
i am not sure i should be doing this in the underlying Query, or in the form
heres my sql
SELECT [CAMPAIGN PRODUCT TABLE].[Campaign ID], [CAMPAIGN PRODUCT
TABLE].[Customer ID], [CAMPAIGN PRODUCT TABLE].ProductName, [CAMPAIGN PRODUCT
TABLE].[Product Category ID], [CAMPAIGN PRODUCT TABLE].[Target Audience ID],
[CAMPAIGN PRODUCT TABLE].[Market Region ID], [CAMPAIGN PRODUCT TABLE].[Market
ID], [CAMPAIGN PRODUCT TABLE].[Flight Start Date], [CAMPAIGN PRODUCT
TABLE].[Flight End Date], [CAMPAIGN PRODUCT TABLE].[Number of Weeks], [Flight
Start Date]+([Number of Weeks]*7) AS [Calc End Date], PRODUCTS
TABLE].[Products ID], [CAMPAIGN PRODUCT TABLE].[Disc Markup Rate], [Flight
Start Date]+7 AS [Week 2], [Flight Start Date]+14 AS [Week 3], [Flight Start
Date]+21 AS [Week 4], [Flight Start Date]+28 AS [Week 5], [Flight Start
Date]+35 AS [Week 6]
FROM ([PRODUCT CATEGORY TABLE] INNER JOIN [CAMPAIGN PRODUCT TABLE] ON
[PRODUCT CATEGORY TABLE].[Product Category ID] = [CAMPAIGN PRODUCT
TABLE].[Product Category ID]) INNER JOIN [PRODUCTS TABLE] ON [CAMPAIGN
PRODUCT TABLE].ProductName = [PRODUCTS TABLE].ProductName
ORDER BY [CAMPAIGN PRODUCT TABLE].[Customer ID], [CAMPAIGN PRODUCT
TABLE].ProductName;