?
Solved

Still another DSum syntax question

Posted on 2011-04-26
2
Medium Priority
?
272 Views
Last Modified: 2012-05-11
Here is what I have right now...

Me.txtBooked = DSum("[QuotedSales]", "OpenJob", "[ProductCode] <> 350 and [BookedDate] between " & "#" & Forms!frmSelectDateRange!txtStart & "#" & " And " & "#" & Forms!frmSelectDateRange!txtStart + 14 & "#" & "")

Please note the "+ 14".   I want this to sum the values of QuotedSales from the field txtStart through txtStart plus 14 days.  What I have above is not working.

--Steve
0
Comment
Question by:SteveL13
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 35466549
Me.txtBooked = DSum("[QuotedSales]", "OpenJob", "[ProductCode] <> 350 and [BookedDate] between " & "#" & Forms!frmSelectDateRange!txtStart & "#" & " And " & "#" & Forms!frmSelectDateRange!txtStart & "# + 14 " & "")
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35466629
try this

 Me.txtBooked = DSum("[QuotedSales]", "OpenJob", "[ProductCode] <> 350 and [BookedDate] between #" & Forms!frmSelectDateRange!txtStart & "# And #" & DateAdd("d", 14, Forms!frmSelectDateRange!txtEnd) & "#")
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question