Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2010
    Posts
    3

    Unanswered: Problem in Selecting time from Query

    Hello,

    I have a problem in selecting time from query my computer language is in Norwegian. I am using visual basic 6 with msaccess.

    when I use Jan,Feb,Mar,Apr as month query gives me the correct resule but when I use May it gives me a error message. I thing it is because of language.
    Because May = mai in Norwegian.

    sql = "select distinct format(ms.match_Date_Time,'hh:mm:ss') from Season s,leauge l,Match_Schedule ms where s.Season_Id=ms.Season_Id and s.Season_Year=" & cmb_Season_Year.Text & " and l.leauge_Id=ms.Leauge_Id and l.Leauge_Name='" & cmb_Leauge_Name.Text & "' and format(ms.match_Date_Time,'dd.mm.yyyy')=#" & Format(cmb_Date.Text, "dd-mmm-yyyy") & "# and NOT EXISTS( SELECT schedule_Id FROM Match WHERE Schedule_Id = ms.Schedule_Id ) order by format(ms.match_Date_Time,'hh:mm:ss')"

    can any one help me in this regard?

    Regards,

    Fawad Munir

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You have to use the US format. Otherwise you're comparing strings.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Dec 2010
    Posts
    3
    Can you give any example of that if possible?thanks.
    Regards,
    Fawad

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    us date format is mm/dd/yyyy
    alternatively you may get away with ISO date format YYYY/DD/MM
    literal dates shouyld be encapsualted with a # symbol
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Dec 2010
    Posts
    3
    yes I am using us date format but when I set. the format mm/dd/yyyy in msaccess it show date like this in database dd.mm.yyyy and when I select that date using query, it gives me the sytax error in date format. If possible can you send me any example in which I can see whole process. I will be very thankful to you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •