MS Access SQL Select command in date range problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tsair

    #1

    MS Access SQL Select command in date range problem

    Select PoHead.*, PoItem.*, PoItem.Tranno as Tranno from PoItem INNER JOIN
    [PoHead] ON PoItem.Tranno = PoHead.Tranno Where PoHead.TranDate >
    #5/10/2005# AND PoHead.TranDate < #9/10/2005# AND TRUE ORDER BY
    PoHead.TranDate , PoHead.Supplier Code, PoHead.ProjectC ode, PoItem.StockCod e

    When

    Date1 = #5/10/2005#

    Date2 = #9/10/2005#

    the command no record selected but when Date2 = #10/10/2005#, the record for
    #6/10/2005# will capture.

    What is the problem ?




  • Franky

    #2
    Re: MS Access SQL Select command in date range problem

    Tsair wrote:[color=blue]
    > Select PoHead.*, PoItem.*, PoItem.Tranno as Tranno from PoItem INNER JOIN
    > [PoHead] ON PoItem.Tranno = PoHead.Tranno Where PoHead.TranDate >
    > #5/10/2005# AND PoHead.TranDate < #9/10/2005# AND TRUE ORDER BY
    > PoHead.TranDate , PoHead.Supplier Code, PoHead.ProjectC ode, PoItem.StockCod e
    >
    > When
    >
    > Date1 = #5/10/2005#
    >
    > Date2 = #9/10/2005#
    >
    > the command no record selected but when Date2 = #10/10/2005#, the record for
    > #6/10/2005# will capture.
    >
    > What is the problem ?
    >
    >
    >
    >[/color]
    you should check out if you are using the right date-format mm/dd/yyyy
    or dd/mm/yyyy

    the representation in sql can be different from the database

    Comment

    • Tsair

      #3
      Re: MS Access SQL Select command in date range problem

      How to set the date both in sql and database are in same format ?

      i am using ACCESS database


      "Franky" <dries@bestopia .be> wrote in message
      news:1134737613 .671621@seven.k ulnet.kuleuven. ac.be...[color=blue]
      > Tsair wrote:[color=green]
      >> Select PoHead.*, PoItem.*, PoItem.Tranno as Tranno from PoItem INNER JOIN
      >> [PoHead] ON PoItem.Tranno = PoHead.Tranno Where PoHead.TranDate >
      >> #5/10/2005# AND PoHead.TranDate < #9/10/2005# AND TRUE ORDER BY
      >> PoHead.TranDate , PoHead.Supplier Code, PoHead.ProjectC ode,
      >> PoItem.StockCod e
      >>
      >> When
      >>
      >> Date1 = #5/10/2005#
      >>
      >> Date2 = #9/10/2005#
      >>
      >> the command no record selected but when Date2 = #10/10/2005#, the record
      >> for #6/10/2005# will capture.
      >>
      >> What is the problem ?
      >>
      >>
      >>
      >>[/color]
      > you should check out if you are using the right date-format mm/dd/yyyy or
      > dd/mm/yyyy
      >
      > the representation in sql can be different from the database[/color]


      Comment

      • carion1

        #4
        Re: MS Access SQL Select command in date range problem

        Can you post a small but working example of the relevant code?

        --

        Derek Davis
        ddavis76@gmail. com

        "Tsair" <lstsair@yahoo. com> wrote in message
        news:OlVf7zjAGH A.2708@TK2MSFTN GP12.phx.gbl...[color=blue]
        > Select PoHead.*, PoItem.*, PoItem.Tranno as Tranno from PoItem INNER JOIN
        > [PoHead] ON PoItem.Tranno = PoHead.Tranno Where PoHead.TranDate >
        > #5/10/2005# AND PoHead.TranDate < #9/10/2005# AND TRUE ORDER BY
        > PoHead.TranDate , PoHead.Supplier Code, PoHead.ProjectC ode, PoItem.StockCod e
        >
        > When
        >
        > Date1 = #5/10/2005#
        >
        > Date2 = #9/10/2005#
        >
        > the command no record selected but when Date2 = #10/10/2005#, the record
        > for #6/10/2005# will capture.
        >
        > What is the problem ?
        >
        >
        >
        >[/color]


        Comment

        Working...