Re: qry-SalesAnalysysCollectData?
From: Maureen (nosend2me_at_hotmail.com)
Date: 05/30/04
- Next message: Duane Hookom: "Re: Obtaning results per Quarters"
- Previous message: Jan: "Expr: Left([dob],4) = omitted an operator?"
- In reply to: Gary Walter: "Re: qry-SalesAnalysysCollectData?"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 30 May 2004 14:11:34 -0400
Gary,
Thanks for your reply. I located a post from Duanes on the topic. It looks
like his suggestion does YTD... I suspect this is a calendar year. What I
want is a 'rolling' sales history for each SKU and Customer that will
provide a comparison of sales for the last 366 day compared to the 366 days
prior rather than YTD.
M
"Gary Walter" <garylwpleasenospam@wamego.net> wrote in message
news:eiG1kbkREHA.1448@TK2MSFTNGP11.phx.gbl...
>
> "Maureen" wrote
> > Gary,
> >
> > Thank for your post. I understand the basics and have the six queries
done
> > for inventory and customer with all of them collected into a master to
drive
> > my report. I thought that perhaps there was a simpler way... I guess
not.
> >
> Hi Maureen,
>
> Did you see Duane's response to
> "Current Date, MTD, YTD, Last Year's MTD"?
>
> Possibly you could use the same method for
>
> M-last 30 days ((t1.InvDate)>=Date()-30)
> Q-last 90 days ((t1.InvDate)>=Date()-90)
> X-last 180 days ((t1.InvDate)>=Date()-180)
> Y-last 366 days ((t1.InvDate)>=Date()-366)
> L-Between day 366 and 732 ((t1.InvDate)>=Date()-732
> And (t1.InvDate)<Date() -
365)
> Z-Life to date
>
> He used the Abs value of date test multiplied
> by Qty and sums that result.
>
> for example:
>
> SELECT
> t2.SKU,
> SUM(NZ(t1.Qty)) AS Z
> SUM(NZ((t1.Qty)*Abs(((t1.InvDate)>=Date()-30))) AS M
> {etc., I did not check parentheses above}
>
> FROM
> tblInventory AS t2
> LEFT JOIN
> tblInvoiceDetail AS t1
> ON t2.SKU = t1.SKU
> GROUP BY t2.SKU
> ORDER BY t2.SKU;
>
>
>
>
>
- Next message: Duane Hookom: "Re: Obtaning results per Quarters"
- Previous message: Jan: "Expr: Left([dob],4) = omitted an operator?"
- In reply to: Gary Walter: "Re: qry-SalesAnalysysCollectData?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|