Re: Dcount : Att Graham Seach

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: [MVP] S.Clark (Steve.Clark_NOSPAM_at_FMSInc.com)
Date: 04/20/04


Date: Tue, 20 Apr 2004 15:59:25 -0400

Things that are known to slow down queries are:

Functions(e.g. Format()) ,
Instant If's (e.g. IIF()), which is also a function, and
Order By clauses
Domain Functions(DSum, Dcount, etc)

So, examine your SQL and ask yourself if you really "need" each occurance of
these.

-- 
HTH,
Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"DD" <anonymous@discussions.microsoft.com> wrote in message
news:E3072757-B677-4AA2-9B07-37F285720034@microsoft.com...
> Hi Graham
> I am creating a small accounts package, i need to have a reconciliation of
payments in and out, my qry below works but it is slow in loading.
> too slow in fact
> I you have any suggestions i would appreciate the help
> DD
>
> SELECT tblPayments.PaymentID, tblPayments.sequence,
Format(FormatNumber([paymentdate]),"00000000") &
Format([tblPayments.PaymentID],"000000") AS d, tblPayments.PaymentDate,
tblPayments.BankDate, [bankdate] Is Not Null AS isbanked,
tblPayments.Banked, tblPayments.Reference, tblPayments.Category,
DSum("amount","tblPaymentDetails","[PaymentID]=" &
[tblPayments].[PaymentID]) AS pa, IIf([isbanked],[pa],0) AS bankedPayment,
tblPayments.receipt, IIf([receipt],[pa],0) AS income, IIf([receipt],0,-[pa])
AS expense,
(Val(DSum("bankedPayment","qryReconciliation","[tblPayments.sequence]<=""" &
[tblPayments.sequence] & """"))) AS bankedBalance,
Format([paymentDate],"yyyymm") AS paymentMonth
> FROM tblPayments INNER JOIN tblPaymentDetails ON tblPayments.PaymentID =
tblPaymentDetails.PaymentID
> ORDER BY Format(FormatNumber([paymentdate]),"00000000") &
Format([tblPayments.PaymentID],"000000");
>


Relevant Pages

  • Re: function as criteria for a query
    ... Write the value to a table with a single record in SQL Server. ... > I have created a public variable called "userId" it stores the user id ... > Public Function fnUserId() ... >> MS Access MVP ...
    (microsoft.public.access.queries)
  • Re: ORDER BY in View and ADP Form
    ... So you are admitting now that Microsoft is NOT committed to ADP's. ... im disagreeing with that David Portas ... WHY DOES EVERY ACCESS MVP DIPSHIT IN THE WORLD NOT UNDERSTAND THE ... Views have no fixed ordering in SQL Server. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Parameter mismatch between ACCESS and SQL server
    ... Doug Steele, Microsoft Access MVP ... It gives the same error that the varchar> cannot be converted to smalldatetime. ... >> I think it depends on whether or not Jet is involved in the process. ... >>>I have a stored procedure in SQL server with a date parameter input that>>> runs fine on the server itself. ...
    (microsoft.public.access.modulesdaovba)
  • Re: sql query ...wrong? in vb.net - please help
    ... It's not necessarily a mistake. ... SQL Server does not. ... Dan Artuso, Access MVP ... > the message, and as it turns out, Bob, it applies to VB as well. ...
    (microsoft.public.vb.database)
  • Re: LookUp box
    ... MS Access MVP ... One has the basic info for each child, (name, address, parent, ... What I want to do is add a table for payments. ... The ContactID value can be stored in other tables. ...
    (microsoft.public.access.tablesdbdesign)