Hi everybody.
I'm trying to base formulas on values in a SQL Server table, but can't get it to work.
The formula is used to calculate sales data for weekly periods, so I created a table in SQL Server with 4 columns:
Quarter; Week; DateFrom; DateTo.
I want my equation, which looks like this:
If {WeeklyByProductQ1.SaleDate}>= Date(2004,01,01) AND {WeeklyByProductQ1.SaleDate}<= Date(2004,01,03)
Then {WeeklyByProductQ1.Quantity}
Else 0
To look something like this:
If {WeeklyByProductQ1.SaleDate}>= Date(SELECT DateFrom FROM Table WHERE "Quarter = 1" AND "Week = 1"
AND {WeeklyByProductQ1.SaleDate}<= Date(SELECT DateTo FROM Table WHERE "Quarter = 1" AND "Week = 1"
Then {WeeklyByProductQ1.Quantity}
Else 0
How do I do this?
Thanks for any help.
-Alan
I'm trying to base formulas on values in a SQL Server table, but can't get it to work.
The formula is used to calculate sales data for weekly periods, so I created a table in SQL Server with 4 columns:
Quarter; Week; DateFrom; DateTo.
I want my equation, which looks like this:
If {WeeklyByProductQ1.SaleDate}>= Date(2004,01,01) AND {WeeklyByProductQ1.SaleDate}<= Date(2004,01,03)
Then {WeeklyByProductQ1.Quantity}
Else 0
To look something like this:
If {WeeklyByProductQ1.SaleDate}>= Date(SELECT DateFrom FROM Table WHERE "Quarter = 1" AND "Week = 1"
Then {WeeklyByProductQ1.Quantity}
Else 0
How do I do this?
Thanks for any help.
-Alan