date between

date between

Hi I�ve wrote a program by Delphi 7, I�ve used an Access database and SQL, and also in my tables I have some fields. One of my fields is date_, and the type of the field is DateTime. When I want to select records between 2 dates, I use this query:

Select * from table1 Where date_ between #01/01/2010# and #31/12/2010#

But it shows me the dates that are not in this query! Why?

View Answers

February 17, 2011 at 11:42 AM

SQL Query to display record between two dates:

SELECT * FROM emp WHERE JOINING_DATE BETWEEN '2000-01-01' AND '2010-01-01' ;

For the above query, here is the database table.

CREATE TABLE `emp` (                                     
          `EMP_NO` int(10) NOT NULL auto_increment,              
          `EMP_NAME` varchar(100) default NULL,                  
          `DESIGNATION` varchar(100) default NULL,               
          `JOINING_DATE` date default NULL,                      
          `SALARY` int(100) default NULL,                        
          `DEPT_NO` int(100) default NULL,                       
          PRIMARY KEY  (`EMP_NO`)                                
        );

February 20, 2011 at 10:47 AM

Thanks, because of your attention.

But unfortunately this is not the correct answer to my question.

I've found where my mistake was. I should change my date format to ââ?¬Å?yyyy-mm-ddââ?¬Â? and then I can got the correct query result.









Related Tutorials/Questions & Answers:
date between
of my fields is date_, and the type of the field is DateTime. When I want to select records between 2 dates, I use this query: Select * from table1 Where date...date between  Hi Iââ?¬â?¢ve wrote a program by Delphi 7, Iââ?¬â?¢ve
SQL Date Between
SQL Date Between       Mysql Date Between return the date between the two existing date... 'Date Between in SQL'. To understand this example we create a table 'Employee1
Advertisements
SQL Between Date
SQL Between Date       The Tutorial help you to understand SQL Between Date. In this Tutorial... Create Table Stu_Table (Stu_Id varchar(2), Stu_Name varchar(15), Stu_Dob date
Hibernate criteria date between Example
Hibernate criteria date between Example  Hibernate criteria date between Example I want example of hibernate criteria date between with source code... between. Check the tutorial hibernate criteria date between. Check the Latest
SQL display date in between query
SQL display date in between query  how to get ( 15 march 2011) and (15/03/2011) output using SQL
Mysql Date in between
Mysql Date in between       The Tutorial illustrates an example Mysql date in between . In this Tutorial we illustrate an example that help you to get the date in between. Query
get data between date using jsp with msaccess
get data between date using jsp with msaccess  hi, urgently i need program for get data between date using jsp with MsAccess database.plz any one can help me.thanks for anyone replay with regards c.b.chellappa
SQL Between Date
SQL Between Date       The Tutorial help you to understand SQL Between Date. In this Tutorial... Create Table Stu_Table (Stu_Id varchar(2), Stu_Name varchar(15), Stu_Dob date
JavaScript check if date is between two dates.
JavaScript check if date is between two dates.  Check if date is between two dates?   <html> <head> <title>Date before...;/head> <body> <h2>Check if date is between two dates</h2>
HQL Date Between Example
HQL Date Between Example In this tutorial I will show you how you can use the HQL Date Between clause in Hibernate program. With the help of HQL between... as invoice5_1_ from invoice invoice0_ where invoice0_.invoice_date between
Hibernate Built-in criterion "between" Date
, gender of Employee2 from the table employeename2 between the specified date...Hibernate Built-in criterion "between" Date In this tutorial you will learn about how to use the built-in criterion ' between '
get data between date from msaccess database
get data between date from msaccess database  here is my code, i want to get data between date using jsp with msaccess.i stored date... like this DATE NUMBER 01-09-2012 1 02-08-2012
Getting the Records in PL/SQl between Date Ranges - JDBC
Getting the Records in PL/SQl between Date Ranges  Getting the records Between the Dates in PL/SQL Database by using JDBC and display through JSP
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  i want difference between the date entered in a jtextfield and the system date in java
Mysql Date Subtract
Mysql Date Subtract       Mysql Date Subtract is used to find the date between the current date and the date before the current date. Understand with ExampleADS_TO_REPLACE_1
Hibernate's Built-in criterion: Between (using with Date)
Hibernate's Built-in criterion: Between (using with Date... this_.investement_date between ? and ? limit ? ID: 1ADS_TO_REPLACE_3 Name: Car... important  method of the Restriction class is between : which is used
date
date   how to insert date in database? i need coding
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
Mysql Date Manipulation
Mysql Date Manipulation       Mysql Date Manipulation find out the difference between two values... an example from Mysql Date Manipulation. To grasp this example, we create a table
date
database table name birthday (DOB date); dob with DATE data type in database while...=d.getTime(); java.sql.Date date = new java.sql.Date(t); try { System.out.println(date); Class.forName("oracle.jdbc.OracleDriver"); con
Mysql Date Comparison
Mysql Date Comparison       Mysql Date Comparison is used to return the date from a table on the basis of comparison between any two values of dates. Understand
DATE
DATE  I have the following as my known parameter Effective Date... of calcultion starts My question is how to find the date of Thursday This cycle... the date of all the thursdays of the given year. import java.util.*; import
SQL Between Datetime
SQL Between Datetime       The Tutorial illustrate an example from SQL Between Date time... is date time. The Date Time structure tell you an instant in time, hold
Mysql Date Ranges
Mysql Date Ranges       Mysql Date Ranges is useful when you want to see the records between... the elaborative example from 'Mysql Date Ranges'. To understand this example
mysql between dates not between dates
mysql between dates not between dates  I am trying to list the data between dates and not between dates using join method ..but that not working for me
hibernate criteria date between
hibernate criteria Date Between Example In this Tutorial, We will discuss... according to like and between condition according to the given dates. Here...("yyyy-MM-dd hh:mm:ss"); Date d1 = (Date) format.parse("2011-04-11 15:21:26
date format - Date Calendar
date format  how to convert dd-mmm-yyyy date format to gregorian... to convert date to calender. import java.util.*; import java.text.*; public...="19-Sep-2008"; DateFormat format ; Date date ; format = new
user defined date class
user defined date class  Develop a user defined date class with public.Fill the members using existing class method.implement the methods for finding current date(),days between method,advanced days and after days
user defined date class
user defined date class  Develop a user defined date class with public.Fill the members using existing class method.implement the methods for finding current date(),days between method,advanced days and after days
difference between SessionState and ViewState
difference between SessionState and ViewState  What is the difference between SessionState and ViewState
difference between == and === operators?
difference between == and === operators?  Is (====) operator available in java or not? difference between
Difference between DispatchAction and LookupDispatchAction
Difference between DispatchAction and LookupDispatchAction  What is the Difference between DispatchAction and LookupDispatchAction
difference between ForwardAction and IncludeAction
difference between ForwardAction and IncludeAction  What is the difference between ForwardAction and IncludeAction
Difference between struts and JSF
Difference between struts and JSF  What is the difference between struts and JSF
Differences between HashMap and Hashtable?
Differences between HashMap and Hashtable?  Differences between HashMap and Hashtable
Date format - Date Calendar
Date format  please convert dd-mmm-yy date format to gregorian calendar date format.  Hi friend, Code related your Problem: import...]); Calendar calendar = new GregorianCalendar(pdt); Date time = new Date
date - Date Calendar
date   hi, sir i am doing student details project in swing but i am not getting current date in jtextfield in date it is giving ambigious error... label=new JLabel("Current Date: "); JTextField text=new JTextField(15
Date Formay - Date Calendar
Date Formay  Sir, How to comapare two different date format in java.  Hi friend, Code to compare two different date import...)) System.out.print("Current date(" + new SimpleDateFormat("dd/MM/yyyy"). format
Date format - Date Calendar
Date format  Hi All, I am getting a date from database as a format 2010-15-07.I need to change it to 07/15/2010 and display it on my date field.Every time i need to check the format of the date field and make sure the correct
SQL Between Datetime
SQL Between Datetime       The Tutorial illustrate an example from SQL Between Date time... is date time. The Date Time structure tell you an instant in time, hold
Date comparison in PHP - PHP
Date comparison in PHP  I am looking for a date comparison code in PHP that can compare the date in between two different date formate.. for example: 11/12/1999 and 11/12/2001 to 11.11.1888 00:00:00 any idea on how
mysql difference between two numbers
between two date. The syntax of DATEDIFF is .. SELECT DATEDIFF('2012-01-31 23:59...mysql difference between two numbers  How to get total bate difference between two dates for example 1/01/2012 and 1/02/2012 in MYSQL?   
Date limit on Dojo Date picker - Date Calendar
Date limit on Dojo Date picker  Hi all, I am using dojo for date picker in my project. When user click on date text box, date picker will pop up. Using that component user can select date. Now I trying something different. I
difference between varchar & varchar2?
difference between varchar & varchar2?  What is the difference between varchar & varchar2
Different between getRequestParameterMap() and getRequestParameterValuesMap()
Different between getRequestParameterMap() and getRequestParameterValuesMap()  What is the different between getRequestParameterMap() and getRequestParameterValuesMap

Ads