Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #1381

Re: VBA code to dynamically create an SQL query for Access db

From colmkav <colmjkav@yahoo.co.uk>
Newsgroups comp.lang.basic.visual.misc
Subject Re: VBA code to dynamically create an SQL query for Access db
Date 2012-07-19 01:24 -0700
Organization http://groups.google.com
Message-ID <df8cd9eb-6e0a-4c99-a347-e62447e7258a@googlegroups.com> (permalink)
References <1e0600a4-e7ef-4eff-9001-45c41482ec1b@googlegroups.com> <ju6hrm$7pt$2@speranza.aioe.org> <141ae15f-9c79-44e1-bfef-d894b1f96715@googlegroups.com> <d2rd08p72cqps5ilngj46j74n91jltgktr@4ax.com>

Show all headers | View raw


On Wednesday, July 18, 2012 7:24:11 PM UTC+2, ralph wrote:
> On Wed, 18 Jul 2012 08:10:03 -0700 (PDT), colmkav
> &lt; wrote:
> 
> &gt;&gt; 
> &gt;&gt; Oh, and multiple tables like that containing the same type of data went 
> &gt;&gt; out of fashion ages ago.
> &gt;&gt; Why not a simple table as such:
> &gt;&gt; Client-ID	RuleNum
> &gt;&gt; 1233		0
> &gt;&gt; 6725		20
> &gt;&gt; 4545		1
> &gt;&gt; 6725		7
> &gt;&gt; 1233		19
> &gt;&gt; 
> &gt;The purpose of the table is that all the rules the client (eg 1233)
> &gt; had breached is summarised in 1 row. ie easy for the customer
> &gt; to read the report.
> 
> I&#39;ll stick my two cents in ...
> 
> One of the first rules of database design is to keep Data separate
> from Presentation. (Actually there are so many &quot;first rules&quot; in
> design, not sure if this is THE first rule or not, but certainly
> deserves honorable mention. &lt;g&gt;)
> 
> The second you decided to design a table to be a &#39;view&#39;, you were in
> trouble. Logically store and normalize your data - then write Views as
> needed.
> 
> -ralph

Some of the subqueries though take a long time to run and are used by numerous queries. So is it not better to save the results in temporary tables and run the queries of these rather than rerun the subqueries each time?

How would I write my query as a crosstab query? I am not that familiar with crosstab queries but when I had a look it didnt seem compatible with what I am trying to do.

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

VBA code to dynamically create an SQL query for Access db colmkav <colmjkav@yahoo.co.uk> - 2012-07-18 04:54 -0700
  Re: VBA code to dynamically create an SQL query for Access db Deanna Earley <dee.earley@icode.co.uk> - 2012-07-18 15:39 +0100
    Re: VBA code to dynamically create an SQL query for Access db colmkav <colmjkav@yahoo.co.uk> - 2012-07-18 08:10 -0700
      Re: VBA code to dynamically create an SQL query for Access db Deanna Earley <dee.earley@icode.co.uk> - 2012-07-18 17:54 +0100
      Re: VBA code to dynamically create an SQL query for Access db ralph <nt_consulting64@yahoo.com> - 2012-07-18 12:24 -0500
        Re: VBA code to dynamically create an SQL query for Access db "Farnsworth" <nospam@nospam.com> - 2012-07-18 15:03 -0400
        Re: VBA code to dynamically create an SQL query for Access db colmkav <colmjkav@yahoo.co.uk> - 2012-07-19 01:24 -0700
          Re: VBA code to dynamically create an SQL query for Access db ralph <nt_consulting64@yahoo.com> - 2012-07-19 11:00 -0500

csiph-web