Date SQL not behaving correctly (British Date Format issue?) - InfoPath Dev
in

InfoPath Dev

Date SQL not behaving correctly (British Date Format issue?)

Last post 10-04-2007 07:33 AM by adamrharding. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-05-2007 03:30 AM

    Date SQL not behaving correctly (British Date Format issue?)

    Hi

    I have a very strange date problem which I can't make sense of.  I have an entry in my database for 28/08/2007.  I build an SQL statement based on a date entered by the user in the form which checks whether there is an entry that has a date <= the date specified.  I do this by substituting the Command on the relevant data adapter and checking the DOM value using selectSingleNode.  When I select a date of 28/08/2007 - it behaves correctly and returns the ID of the row - good.  If I enter the 27/08/2007 it behaves correctly and doesn't find a row - good.  This works for 29th, 30th and 31st August too - but as soon as I enter 01/09/2007 the query doesn't return a row when it should because 28/08/2007 <= 01/09/2007?

    I don't get why it is behaving like this.  Could it be a bug related to conversion to British date format?  Please help.

    I have converted my date into a vbdate and the SQL is valid.

    Thanks & regards.  Stanton.

  • 09-05-2007 04:53 AM In reply to

    Re: Date SQL not behaving correctly (British Date Format issue?)

    hi, have you tried the same query statement with the sql query analyzer. in my opinion this is not an infopath related problem, the only thing i can imagine is that you have a little bug in your query ? where does the date you are using as the input value from infopath into your query come from ? from a datepicker control ? if yes then you have to keep in mind that no matter what you select as the format of the date in the datepicker infopath always uses the same format in the background. maybe have also a look here: http://www.infopathdev.com/forums/p/5008/19319.aspx#19319

    Listen to Motörhead cos they play Rock'n Roll :)
  • 10-04-2007 07:33 AM In reply to

    Re: Date SQL not behaving correctly (British Date Format issue?)

    Hi

    I agree with nukkumatti, it sounds like you query is not looking at the whole date but more the day part of the date hence 28 is less than 29 30 and 31 but not less than 01 02 03 etc.

    Sounds like this could be your problem

    Cheers Adam

    Adam Harding
    Wales
    UK
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.