Quarterly Sales Tax Query

C

CoachBarkerOJPW

Problem
I am trying to create a query from two unrelated tables, I have

tblSales tblSalesTax
SaleID SalesTaxID
DateOfSale WeekBeginning
TaxAmount WeekEnding
SubTotal AmountOwed
TotalSale

From tblSale I run this Query to get the quarterly amount of Sales Tax (this
is a dynamic query in a data acces class in VB.NET where the variables are
(dateofsale, beginning date,endingDate) ;
SELECT Sum([TotalSale])-Sum([SubTotal]) AS QuarterSalesTax
FROM tblSale
WHERE (((tblSale.DateOfSale) Between #01/1/2006# And #03/31/2006#));

This query works for me to get the amount of Sales Tax for each Quarter.

What I would like to do is assign from tblSale to tblSalesTax

DateOfSale = weekBeginning
DateOfSale = weekEnding
QuarterSalesTax = AmountOwed

Is this possoble or am I trying to do something that can not be done?

Or is it possible when the DateOfSale, SubTotal and TotalSale are added to
tblSale that they can also be added to tblSalesTax as weekBegining,
weekEnding, SubTotal and TotalSale and then do the calculation for
QuarterSalesTax from there?

Thank you
CoachBarkerOJPW
 
A

Alp Bekisoglu

I'm no expert but I'll just indicate my opinion, so to speak. Since you can
get your quarterly amount owed as you want, you can also get weekly amounts
just by changing the date span in your query. Thus, since the result can be
calculated, why do you feel the need to store a calculateable data in
another table?

Alp
 
C

CoachBarkerOJPW

I figured out what I needed to do, thanks for your input.

Alp Bekisoglu said:
I'm no expert but I'll just indicate my opinion, so to speak. Since you can
get your quarterly amount owed as you want, you can also get weekly amounts
just by changing the date span in your query. Thus, since the result can be
calculated, why do you feel the need to store a calculateable data in
another table?

Alp

CoachBarkerOJPW said:
Problem
I am trying to create a query from two unrelated tables, I have

tblSales tblSalesTax
SaleID SalesTaxID
DateOfSale WeekBeginning
TaxAmount WeekEnding
SubTotal AmountOwed
TotalSale

From tblSale I run this Query to get the quarterly amount of Sales Tax
(this
is a dynamic query in a data acces class in VB.NET where the variables are
(dateofsale, beginning date,endingDate) ;
SELECT Sum([TotalSale])-Sum([SubTotal]) AS QuarterSalesTax
FROM tblSale
WHERE (((tblSale.DateOfSale) Between #01/1/2006# And #03/31/2006#));

This query works for me to get the amount of Sales Tax for each Quarter.

What I would like to do is assign from tblSale to tblSalesTax

DateOfSale = weekBeginning
DateOfSale = weekEnding
QuarterSalesTax = AmountOwed

Is this possoble or am I trying to do something that can not be done?

Or is it possible when the DateOfSale, SubTotal and TotalSale are added to
tblSale that they can also be added to tblSalesTax as weekBegining,
weekEnding, SubTotal and TotalSale and then do the calculation for
QuarterSalesTax from there?

Thank you
CoachBarkerOJPW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top