Click here to Skip to main content
12,896,806 members (61,284 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
MS Access Data Base;

when i run the below query;

select * from Tb_SCh_TIme_Table

 Sch_Date	Session	Course	Faculty_Code
2/11/2013	1	ARPA	BAB
2/12/2013	1	CHEMCO	BSR
2/13/2013	3	CL2	CJJ 


when i run the Below query
select * from Tb_SCh_TIme_Table where Sch_Date = 2/11/2013


The output is not coming why?

what is the problem in my above query?

Please help me.

Regards,
Narasiman P.
Posted 24-Feb-13 20:31pm
Updated 24-Feb-13 21:09pm
v2
Comments
Shubh Agrahari 25-Feb-13 2:54am
   
something error showing...???
Shubh Agrahari 25-Feb-13 2:56am
   
try this...

select * from Tb_SCh_TIme_Table where Sch_Date = '2/11/2013'

or

select * from Tb_SCh_TIme_Table where Sch_Date = "2/11/2013"

or check with change the format like....2-11-2013
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

use this query
"select * from Tb_SCh_TIme_Table where Sch_Date = #2/11/2013#"

also go through following link.
http://office.microsoft.com/en-in/access-help/where-clause-HP001032287.aspx[^]
  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

please try this:

select * from Tb_SCh_TIme_Table where Sch_Date like '2/11/2013'

or
select * from Tb_SCh_TIme_Table where Sch_Date = '2/11/2013'
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

try this

Datetime date = DateTime.Parse("2/11/2011");
// initialize the vaialbe


now write the query.

select * from Tb_SCh_TIme_Table where Sch_Date = '"+ date +"' ;
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 25 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100