Posted on 2003-02-20
Medium Priority
Last Modified: 2013-11-23
I am trying to quote dates in the sql of a query, and am wanting to say where mvtdate BETWEEN :DateTo AND :DateFrom

It doesn't like this.  I have tried <= and >= but it still doesn't work.  Any ideas?
Question by:gleads
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 27

Expert Comment

ID: 7988298
>where mvtdate BETWEEN :DateTo AND :DateFrom

should work (if it is supported by your database)

can you show, how you do supply the paramaters

meikl ;-)

Author Comment

ID: 8007100
What fromat should dates be in in order for the query to work.  At the moment, it returns no rows, so I am thinking that with a date e.g. 21/02/2003, it is dividing 21 by 2 by 2003 and therefore not returning any records.

Accepted Solution

grolschisgood earned 60 total points
ID: 8217250
normally dates should be specified mm/dd/yyyy.  Particularly MSSQL, MySQL, and Interbase use mm/dd/yyyy under a default installation.  Alternatively try yyyy-mm-dd as this is widely recognised by most sql servers.

eg  select * from dr_transactions where transdate between '2002-11-21' and '2002-12-21'

note that the dates past int the above query are string representations.


Author Comment

ID: 8217284
Already solved it a while ago but  I will give you the points anyway as I don't know how to remove a question

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month12 days, 5 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question