Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query run, cannot add new record

Status
Not open for further replies.

dbar10

Programmer
Joined
Dec 5, 2008
Messages
196
Location
US
I have built a query that pulls past records in a certain month, and allows to add new records. This worked just fine ubtil I realized that I have to be able to distinguish rates by date as they change every year. I added a Rates Billing query along with the existing tables. It goes out and finds the rates just fine for existing records but I cannot add new records. below is the SQL statement for the query. Can you please help?

SELECT [Units Worked Table].UnitsID, [Units Worked Table].[Invoice #], [Units Worked Table].Date, [Worker table].LastName, [Units Worked Table].WorkerID, Services.ServiceID, [Units Worked Table].Service, [Units Worked Table].[Hours Worked], [Units Worked Table].Billed, [Units Worked Table].Paid, [Units Worked Table].Adjusted, [Units Worked Table].AuthID, [Units Worked Table].ClientID, [Units Worked Table].Modifier1, [Units Worked Table].Modifier2, [Units Worked Table].Modifier3, [Units Worked Table].Suspence, [Rates Billing Query].EffecDate, [Rates Billing Query].[Expire Date], [Rates Billing Query].Program, [Rates Billing Query].UnitConv, [Units Worked Table].Units, [Units Worked Table].AmtBilled, [Units Worked Table].AmtPaid
FROM ([Worker table] INNER JOIN (Services INNER JOIN [Units Worked Table] ON Services.ServiceID = [Units Worked Table].Service) ON [Worker table].WorkerID = [Units Worked Table].WorkerID) INNER JOIN [Rates Billing Query] ON Services.ServiceID = [Rates Billing Query].ServiceID
WHERE ((([Units Worked Table].Date)>=[Forms]![Billing Work Form]![MOStart] And ([Units Worked Table].Date)<=[Forms]![Billing Work Form]![MOEnd]) AND (([Rates Billing Query].EffecDate)<=[Forms]![Billing Work Form]![MOEnd]) AND (([Rates Billing Query].[Expire Date])>=[Forms]![Billing Work Form]![MOEnd]) AND (([Rates Billing Query].Program)=[Forms]![Billing Work Form]![ProgChoice]))
ORDER BY [Units Worked Table].UnitsID, [Units Worked Table].Date;


Thanks, Doug
 
thank you, Duh!! I forgot about using an an update query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top