Re: convert access crosstab to sqlview?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Duane Hookom (duanehookom_at_NO_SPAMhotmail.com)
Date: 04/19/04


Date: Sun, 18 Apr 2004 23:57:50 -0500


"run faster" is related to total number of records, users, network,...
Just understand that your query uses several issues when converted to SQL
Server. Some are already mentioned such as SQL Server doesn't support
crosstabs. I also question the use of:
-"!"
-Nz() which can be replaced by Coalesce()

-- 
Duane Hookom
MS Access MVP
"Maureen" <nosend2me@hotmail.com> wrote in message
news:uPO4crbJEHA.2556@TK2MSFTNGP11.phx.gbl...
> Duane,
>
> Thanks for the note, I know very little about sql other than the fact
views
> run at 1000% faster than comparable queries. Will the code you suggested
run
> faster? I am not familiar with "CASE WHEN"  I am trying to improve
> performance on several reports that I have. rac2sql looks interesting and
be
> very helpful thanks for the suggestion.
>
> M
>
> "Duane Hookom" <duanehookom@NO_SPAMhotmail.com> wrote in message
> news:ue7tbaZJEHA.232@TK2MSFTNGP12.phx.gbl...
> > I assume you are referring to a SQL Server view which does not support
> > TRANSFORM (until some future version). There is a third party utility
that
> > can be very helpful http://www.rac4sql.net/.
> >
> > You can also use the Sum( CASE WHEN DateDiff(w,FieldOne, GetDate()) = 0
> then
> > Quantity ELSE 0) as Wk0
> > caution air code above.
> >
> > I would also take this opportunity to change all of your table and field
> > names to remove those spaces.
> > -- 
> > Duane Hookom
> > MS Access MVP
> >
> >
> > "Maureen" <nosend2me@hotmail.com> wrote in message
> > news:eiyxMNZJEHA.1392@TK2MSFTNGP09.phx.gbl...
> > > TRANSFORM Nz(Sum([Invoice Footer History]![Quantity]),0) AS Quantity
> > > SELECT Inventory.MANUF, [Invoice Footer History].[Product Code],
> > > Inventory.Description
> > > FROM Inventory INNER JOIN ([Invoice Footer History] INNER JOIN
[Invoice
> > > Header History] ON [Invoice Footer History].[invoice number] =
[Invoice
> > > Header History].Invoice) ON Inventory.ProdCode = [Invoice Footer
> > > History].[Product Code]
> > > GROUP BY Inventory.MANUF, [Invoice Footer History].[Product Code],
> > > Inventory.Description
> > > ORDER BY Inventory.MANUF
> > > PIVOT "Wk" & DateDiff("ww",[Invoice Date],Date()) In
> > >
> >
>
("Wk0","Wk1","Wk2","Wk3","Wk4","Wk5","Wk6","Wk7","Wk8","Wk9","Wk10","Wk12","
> > > Wk13");
> > >
> > >
> > > I am converting a number of things from access qry's to sql views.
Most
> > are
> > > working just fine with some minor tweaking. On this I am getting a
> "syntax
> > > error near SUM" any suggestions?
> > >
> > > M
> > >
> > >
> >
> >
>
>


Relevant Pages

  • RE: Fulltext failure on a 2 node cluster
    ... Server full-text search resource online: "SQL Cluster Resource 'Full Text' ...
    (microsoft.public.sqlserver.clustering)
  • Re: HELP PLEASE ~ ???
    ... You mentioned that it went ahead and added a SQL ... SQL Server 2000 database for all my data. ... find the connectionString in the newly recreated SQLExpress database. ... The connection string specifies a local Sql Server Express instance ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Multi-Channel Raid VS SAN Storage
    ... A 5~6 years old server is a very old server. ... As I mentioned, the server is one node in a cluster environment, and SQL is ... We actually are running RAID 1+0 and our aplication is definately more ... needs it's own SAN device, or at least a dedicated IO channel on the SAN. ...
    (microsoft.public.sqlserver.setup)
  • Re: Multi-Channel Raid VS SAN Storage
    ... A 5~6 years old server is a very old server. ... As I mentioned, the server is one node in a cluster environment, and SQL is ... We actually are running RAID 1+0 and our aplication is definately more ... needs it's own SAN device, or at least a dedicated IO channel on the SAN. ...
    (microsoft.public.sqlserver.setup)
  • RE: How do I get back to base SQL server on my SBS 2003 server?
    ... After you uninstall SQL 2005, the instance which you upgraded will not go ... Uninstall and then reinstall ISA server. ... Uninstall and then reinstall the Monitoring component. ... Tools to Maintenance, change Monitoring component to Install, and then ...
    (microsoft.public.windows.server.sbs)