Re: Newbie. Reports & SQL.

From: Glenn Someone (dontspamme_at_whydoyouneedmyaddressspammers.com)
Date: 08/09/04


Date: Mon, 09 Aug 2004 11:47:25 -0500

Yes basically what I was saying was that. Define two variables
(consultant_total, grand_total), add your values as you fetch in each
row and then when the consultant changes, display your sub-footer and
zero out the consultant total. Then when you finish pulling in all
your data, display the bottom footer from your total variable. Yes
it's that simple.

The other option really is a bad option, and is bad form for many many
reasons. That involves writing SQL to produce a SUM value for each
consultant, and then producing an SQL to produce a SUM value for the
whole table. One thing about becoming a good programmer is to be able
to figure out many options and select the best option, weeding out
the bad. And this is a bad one, so it's not really worth considering
if you want some advice, since the supporting code mentioned above
will be so much faster/easier all the way around in every way
imaginable.

SQL references. I'm not aware of any good ones on the web, but my
favorite books I've come across are ones by Rick van der Laans and Joe
Celko, since they seem general and focused on the standard and not any
particular product. Related Amazon links are below that should give
you more information. Keep in mind, though, that Access is really
just a glorified file system, and you won't get much out of it SQL
wise. But these should be a good start if you're looking for a book
or two on it.

http://www.amazon.com/exec/obidos/tg/detail/-/0201596180/qid=1092069932/sr=1-1/ref=sr_1_1/002-4860131-4320844?v=glance&s=books
http://www.amazon.com/exec/obidos/tg/detail/-/1558605762/qid=1092069786/sr=1-1/ref=sr_1_1/002-4860131-4320844?v=glance&s=books

On Mon, 9 Aug 2004 20:53:12 +1000, "Trevor" <trevorf@myaccess.com.au>
wrote:

>Hi Again; Thanks for the reply..
>
>So lets see if I understand this, Your saying that in the report I can
>add actual code to sum a field into a temp variable, as it is retrieved,
>and then display that temp variable, on the form in a matching field...?
>If I have this correct then yes that should be relatively simple.. :-)
>Lets just see how hard I can make it..
>
>I'm also interested in your other option, use multiple select statements,
>and output the results that way. The database is small, and is self standing
>on a single machine with only one user, (who by the way has bad eyesight..)
>so speed is not really a huge issue. But still interesting point to be aware of
>in the development stage.
>
>I get the feeling that I need to improve my SQL, do you know any
>good references or web sites.



Relevant Pages

  • THINGS YOUD LOVE TO SAY OUT LOUD AT WORK
    ... I'm a consultant. ... It sounds like English, but I can't understand a word you're ... saying. ... Ahhh...I see the screw-up fairy has visited us again. ...
    (uk.rec.humour)
  • Re: SQL Runs in Access and not in ASP: 0x80040E10 Too few parameters
    ... Your expression is saying the equivalent of ... > These elements of my SQL string will come from variables in the ... Do you get the results you intend to get? ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: sql Statement Date object
    ... he is saying you should use a parameterized query. ... >> For your datetime column, you might have better luck by passing a ... >>> I have an ASP.net application with a connection to a sql database. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: And so the world turns
    ... > Well, shit happens, and I've actually been saying I need a bit of a ... > preferably within a 50 mile radius of Gloucestershire? ... Actually, I fancy going self employed, as a consultant. ... I'm not really a consultant but having given up contracting 1.5 years ago to ...
    (uk.rec.motorcycles)
  • Re: Im having trouble with SQL
    ... > ENoResultSet saying that the BDE can't find the cursor handle. ... > SELECT statement to the SQL command, ... I remember seeing some SQL command in the InterBase SQL ... In the BDE ...
    (comp.lang.pascal.delphi.misc)