C# - SQL Query with Long Date Time?

I am trying to pass a SQL query through c# , currently it is based on just the day month and year with time always set to 0 EG 1997-10-28 00.00.00.000 which is great as the time never changes it easy for me to just Select Where date equals the calendar date.

However with the Start Field , the time is different on each record , eg 1899-12-30 14.14:00.00.000 , 1899-12-30 15.14:30.00.000 . (Seconds downwards are always the same) .

So I need to have a query that will return all the results of the selected date on the "Start" field . How would I do this?.

E.G IF i click the calendar which passes 1997-10-28 00.00.00.000 , I would like the results of every time in that day!. How do I go about that?.

Thanks for any input.

EDIT: Is there a way to format the date that i have in SQL ?. This comes from an old access database!. and as you can see above it is 1899-12-30 ?. not 1998 , I don't know why this has happened!.

This question and answers originated from www.stackoverflow.com
Question by (8/5/2011 11:44:54 AM)

Answer

WHERE DATEDIFF(dd, your_start_field, @your_param) = 0
Answer by

Find More Answers
Related Topics  c#  sql  datetime
Related Questions
  • sql server and long date time

    HI: I need to convert a bigint filed in database to equivalent datatime i couldn't do this from sqlserver nor visual studio i have tried ticks but its not useful any idea? thanks alot
  • sql query date time

    i have a datestamp field in my table structure. using sql, i want to find any user who registered in yesterdays date using these time range. eg: 2010-02-06 14:00:00 2010-02-07 10:00:00 i will…
  • SQL Server 2005 Date Time stamp Query

    One of my columns type is DateTime (Date Registered). I cannot create a query that filters all the data for eg. All registrations who registered on the 22/10/2008 between 18:00 and 20:00. Thanks
  • SQL 2005 SP3 long time query

    I have note, that responding time for query is act like sinusoid. Once this time is very short, another time my app must wait abount 10 min for query result. Problem start when I install update my s…
  • MS-SQLSERVER - SQL Query using ROW_NUMBER taking long time with 0 result from query

    select autoid from (SELECT ROW_NUMBER() OVER (ORDER BY MYTABLE.DETECTEDUTC DESC) as rownum, autoId from MYTABLE where MYTABLE.guid in (..guids..)) as tab1 where rownum >=1000 and rownum < 10…
  • Sql PHP date time

    I want to read all the user feed entered by the user in the last 2 days. Table - user_feed Column - date_n_time What i'm looking for - $result = "SELECT content FROM user_feed WHERE date_n_time >…
  • 'Order By ' SQL issue (out of range date/time value)

    I'm having an issue with the below query: SELECT Consignments.LegacyID, Consignments.TripDate, Consignments.CollectionName, CASE WHEN Sage2.InvoiceSummaryType = 'HT' THEN Delivery…
  • SQL QUERY ( SQL SERVER) Date & Time Difference

    I have a SQL SERVER Table which has only one field "StartDate" the records are as follows ** 2011-07-28 19:30:00.000 2011-07-29 21:50:00.000 2011-07-25 09:20:00.000 ** What i want to do …
  • SQL Server - Playing with Date Time

    I am building an SSRS report. In the report, the week always runs from Monday - Sunday. And I want to find out the START and END dates of prior two weeks. For example, If current date = Ja…
  • Date & time query question (SQL Server 2008)

    I have table that contain date and time field. id|date|time ========= 1|01/01/2001|10:45 2|01/02/2002|11:45 3|01/03/2003|12:45 4|01/04/2004|12:55 I need to know the difference between the MAX…