SQL Query into Excel Data Base Manaual Corrections Problem

Annie S

New Member
Joined
Oct 30, 2005
Messages
25
My SQL Query is going into a Excel Data Base. The information is coming from 3 retail stores. Occasionally one of the POS systems will go down and we need to enter information in manually. This is where the problem starts. When I have made error corrections manually in the excel database it gets over written. If I make a month end adjustment to sales using the last day of the month, which already has a sales day it now starts to double the days in the data base. Any suggestions.

SELECT DISTINCTROW Year([sbdate]) AS [Year], IIf([month]>=10,[month]-9,[month]+3) AS [Fiscal Month], Month([sbdate]) AS [Month], DBA_SysBal.storenum, DBA_SysBal.sbdate, DBA_SysBal.netsales, DBA_SysBal.overshort, DBA_SysBal.avgticketcust, DBA_SysBal.disccount, DBA_SysBal.totaldiscounts, DBA_SysBal.custcount, DBA_SysBal.transvoidttl, DBA_SysBal.refundcount, DBA_SysBal.refundttl, DBA_SyB_Spec.spfldcount, DBA_SyB_Spec_1.spfldcount, DBA_SyB_Spec_2.spfldcount, IIf([cash donations for excel.cash donations] Is Null,0,[cash donations for excel.cash donations]) AS [Cash Donations]
FROM (((DBA_SysBal LEFT JOIN DBA_SyB_Spec ON DBA_SysBal.id = DBA_SyB_Spec.headerid) LEFT JOIN DBA_SyB_Spec AS DBA_SyB_Spec_1 ON DBA_SysBal.id = DBA_SyB_Spec_1.headerid) LEFT JOIN DBA_SyB_Spec AS DBA_SyB_Spec_2 ON DBA_SysBal.id = DBA_SyB_Spec_2.headerid) LEFT JOIN [Cash Donations for Excel] ON (DBA_SysBal.storenum = [Cash Donations for Excel].storenum) AND (DBA_SysBal.sbdate = [Cash Donations for Excel].rcpdate)
WHERE (((DBA_SyB_Spec.spfldnumber)=2) AND ((DBA_SyB_Spec_1.spfldnumber)=3) AND ((DBA_SyB_Spec_2.spfldnumber)=4))
ORDER BY DBA_SysBal.sbdate;
 

Forum statistics

Threads
1,226,887
Messages
6,193,513
Members
453,804
Latest member
Daniel OFlanagan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top