80Problem comparing date in MS Access and c# query

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2008
Posts: 1
Reputation: akshaycjoshi is an unknown quantity at this point 
Solved Threads: 0
akshaycjoshi akshaycjoshi is offline Offline
Newbie Poster

80Problem comparing date in MS Access and c# query

 
0
  #1
Aug 16th, 2008
Hi,
I am developing one application which requires me to compare date.The dataabse being MS access 2003.
When i execute the query in c# it does not show any record ,the date although matches with the date in database.
Where is the problem ?

The quey executed is

select * from finetable where fine_date=#1/9/2008 6:46:36 PM#

The record which matches it being

finetable (table name)
serial_no fine_date reg_no fine_place fine_code
3 1/9/2008 6:44:55 PM 125 india 123A

Why it is not showing ??
Maybe coz the time is diff. But I want to compare dates only.

Please help me !


80 in the topic name is a typo
Last edited by akshaycjoshi; Aug 16th, 2008 at 11:46 am. Reason: typosss
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: 80Problem comparing date in MS Access and c# query

 
0
  #2
Aug 18th, 2008
yes the time is different so it wont match, if you want to match on date alone you would need to do change it so it extracts the date from the fine_date field and the date of the part in question.. I dont have access on here to check but something like date(file_date)=#1/9/2008# would probably work.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC