<sigh> I have everything in this query from hell working now EXCEPT the last
item...the dates.

I'm using the Calendar Control, but even when I enter the dates in manually
for testing, it doesn't like the info. This is a critical part of the
report, so I have to get this working somehow. (I hate computers!)

Everything works UNTIL I add in the date portion. (And yes, I've even had
someone else check the field names!<g>) Below is the code w/vars, w/manual
dates and the resulting string.

Here's the code w/vars...Error: Data type mismatch in criteria expression.

  gstrSQLQuery = _
      "SELECT * FROM Referrals " _
         & "INNER JOIN Customer ON Referrals.CustomerID =
Customer.CustomerID" _
         & " WHERE Referrals.TellerID = " _
         & Chr(34) & strSingleTeller & Chr(34) _
         & " AND Referrals.Sales = True" _
         & " AND Referrals.ReturnDate BETWEEN " _
         & Chr(39) & datReportFromDate & Chr(39) & " AND " _
         & Chr(39) & datReportToDate & Chr(39) _
         & " ORDER BY TellerID, TellerDate"

Here's the code wout/vars...Error: Data type mismatch in criteria
expression.

  gstrSQLQuery = _
     "SELECT * FROM Referrals " _
        & "INNER JOIN Customer ON Referrals.CustomerID =
Customer.CustomerID" _
        & " WHERE Referrals.TellerID = " _
        & Chr(34) & strSingleTeller & Chr(34) _
        & " AND Referrals.Sales = True" _
        & " AND Referrals.ReturnDate BETWEEN " _
        & "'12/7/2004' AND '12/10/2004'" _
        & " ORDER BY TellerID, TellerDate"

Here's resulting string.

SELECT * FROM Referrals INNER JOIN Customer ON Referrals.CustomerID =
Customer.CustomerID WHERE Referrals.TellerID = "444" AND Referrals.Sales =
True AND Referrals.ReturnDate BETWEEN '12/7/2004' AND '12/10/2004' ORDER BY
TellerID, TellerDate


The vars are set as Date and the RS fields are Date/Time w/a mask of
99/99/9999.

TIA for any help!

Dian ~


-- 
This email scanned and certified clean by AVG!
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 265.4.8 - Release Date: 12/8/2004
 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~-> 

---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to