Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 21st, 2004, 02:31 PM
Authorized User
 
Join Date: Mar 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Rood67
Default

Quote:
quote:Originally posted by Bob Hansen
 Good catch Steven......now it will only take me a year to break down and understand those additional quote marks. Why are they needed here?

They definitely are not in the sample code that was provided by Microsoft, regerenced by Rood67. And that code works for me. Is there some type of patch/change between versions that may have caused the need for additional quotes? I was doing test with Access 2000, and the samples are titled Access 2000 queries.
Bob,
     I tried every way possible to get this to work with it being text, but it will not. The M$ example is using a number field, not text. When I altered the table to to be in the form of:
1 Total1 10/04/2004 4
2 Total2 10/04/2004 2
etc...
and used the number field as the DSum "where" clause, it works just fine. So to do the text field, you must use the additional quotes which tells Access that you are using text within text, basically. It's a little more than that, but that's how I remember it.

I would apologize for causing you more confusion, but hopefully this will get you the solution you were looking for.

Rood67
Scott H.

P.S. To get it to pull the date associated with the Total1, Total2, etc... I used this:
SELECT tblTestForForum.Name AS NameA, DLookUp("Date","tblTestForForum","Name <='" & [NameA] & "'") AS TestDate, DSum("Value","tblTestForForum","Name <='" & [NameA] & "'") AS RunTot
FROM tblTestForForum
GROUP BY tblTestForForum.Name;

The reason for the DLookup is that with this query we are using the Totals section, and if you do not do a DLookup and set it to Expression, you would get the Min, Max, Count, etc... and it scews the results. This only becomes a problem if your table will contain:
Total1 10/04/2004 4
Total2 10/04/2004 3
...
Total1 10/06/2004 8
Total2 10/06/2004 6

Which this still isn't perfect, because you get things GroupBy the name Total1, Total2, and it still pulls the first date it comes to. Sorry to open another issue, but maybe you can post if this will be the case, and someone smarter than I can help you work around this.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting my sql select to use LEFT JOINs elfranko PHP Databases 0 December 1st, 2005 07:01 AM
Converting to MYSQL from sql server 2000 olambe BOOK: ASP.NET Website Programming Problem-Design-Solution 5 March 22nd, 2005 10:59 AM
Converting a Jet query to SQL that uses a function Mitch SQL Server 2000 5 February 28th, 2005 12:33 PM
Converting mysql arrays to strings robertjshillito Beginning PHP 3 February 25th, 2005 04:11 PM
converting MySQL tables to SQL Server using PHP vishal148 Access 2 July 3rd, 2004 10:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.