0

I'm trying to SELECT based on a date in OpenOffice Base:

SELECT *
  FROM OrderTbl
  WHERE OrdDate BETWEEN #1/1/2007# AND #1/31/2007#

I've tried a number of variations, but nothing is working. What is the correct syntax?

1
  • have you tried single quotes instead of #s? Commented Jun 30, 2009 at 2:20

2 Answers 2

1

This should work:

SELECT * 
FROM OrderTbl
WHERE OrdDate BETWEEN '2007-01-01' AND '2007-01-31' 
Sign up to request clarification or add additional context in comments.

Comments

0

use below Query SELECT * FROM OrderTbl WHERE OrdDate BETWEEN cast(convert(varchar,'1/1/2007',101) as datetime) AND cast((varchar,'1/31/2007',101) as datetime)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.