• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

ADO QUERIES SQL

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?
0
gleads
Asked:
gleads
  • 2
1 Solution
 
kretzschmarCommented:
>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 ;-)
0
 
gleadsAuthor Commented:
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.
0
 
grolschisgoodCommented:
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.

k
cam
0
 
gleadsAuthor Commented:
Already solved it a while ago but  I will give you the points anyway as I don't know how to remove a question
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now