and, at the very least, maybe put the date1 and date2 vars into
createODBCDate() functions (are they date/time datatypes in the database?
if so, they don't get single quotes around the values).

but like Pascal said...<cfqueryparam> would be much, much better

WHERE
    cd.dailiesDate between <cfqueryparam value="#date1#"
cfsqltype="cf_sql_date"> AND <cfqueryparam value="#date2#"
cfsqltype="cf_sql_date">

----- Original Message -----
From: "Paul Vernon" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, May 28, 2004 8:37 AM
Subject: RE: SUM column data

> You are mixing up your shorthand table references with full table
references
> so the query should read something like this....
>
> SELECT SUM(postageCost) as totalPostage
> FROM tblClientDailes cd inner join tblClients C on c.clientName =
> cd.clientName
> WHERE cd.dailliesDate between '#date1#' and '#date2#'
> AND c.acctStatus = 'A'
> AND cd.clientName like '%marsh%'
> GROUP BY by c.clientName
>
> Or
>
> SELECT SUM(postageCost) as totalPostage
> FROM tblClientDailes inner join tblClients on tblClients.clientName =
> tblClientDailes.clientName
> WHERE tblClientDailes.dailliesDate between '#date1#' and '#date2#'
> AND tblClients.acctStatus = 'A'
> AND tblClientDailes.clientName like '%marsh%'
> GROUP BY by tblClients.clientName
>
> Paul
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to