开发者

data type mismatch when comparing dates in MS-Access

开发者 https://www.devze.com 2022-12-30 00:29 出处:网络
I have dates stored in an MS-Access table in the \'General Date\' format. I\'m trying to create a query that returns records between a specific date range (all records from March 2010) however I enco

I have dates stored in an MS-Access table in the 'General Date' format.

I'm trying to create a query that returns records between a specific date range (all records from March 2010) however I encounter a 'data type mismatch in critera expression' message.

Here is my statement;

SELECT Loan.loan_datetimeLeant, product_name, 
      [product_artist/director], product_category, loanItem_cost

FROM Loan 
INNER JOIN ((Product 
INNER JOIN It开发者_JAVA百科e
ON Product.[product_id] = Item.[product_id]) 
INNER JOIN Loan_Items 
ON Item.[item_id] = Loan_Items.[item_id]) 
ON (Loan.[cust_id] = Loan_Items.[cust_id]) 
AND (Loan.[loan_datetimeLeant] = Loan_Items.[loan_datetimeLeant])

WHERE Loan.loan_datetimeLeant >= '01/03/2010' 
AND Loan.loan_datetimeLeant <= '31/03/2010'

ORDER BY Loan.loan_datetimeLeant;

I have tried variations on the date format (mm/dd/yyyy, dd/mm/yyyy 00:00:00)


the delimiter for Access Dates is the #:

WHERE Loan.loan_datetimeLeant >= #03/01/2010# AND Loan.loan_datetimeLeant <= #03/31/2010#
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号