Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Date/Time field in MS Access

Date/Time field in MS Access

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpquestionlounge
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yamini
    wrote on last edited by
    #1

    Hi, I have query regarding Dates/Time field in MS Access.In MS Access Database I am using one of the field is Date/Time.I am using "General Date" .(i.e)6/27/01 6:59:00 .I am using SQL Query to get all the Records within two date ranges.The query looks like this SELECT * FROM WHERE BETWEEN And I am getting all the records inclusive of lower bound but exclusive of the upper bound date. What may be the problem.Have I to modify the query ? Regards, yamini.

    L 1 Reply Last reply
    0
    • Y yamini

      Hi, I have query regarding Dates/Time field in MS Access.In MS Access Database I am using one of the field is Date/Time.I am using "General Date" .(i.e)6/27/01 6:59:00 .I am using SQL Query to get all the Records within two date ranges.The query looks like this SELECT * FROM WHERE BETWEEN And I am getting all the records inclusive of lower bound but exclusive of the upper bound date. What may be the problem.Have I to modify the query ? Regards, yamini.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      between ? and ? how do you declare the range?,it's very important.

      Y 1 Reply Last reply
      0
      • L Lost User

        between ? and ? how do you declare the range?,it's very important.

        Y Offline
        Y Offline
        yamini
        wrote on last edited by
        #3

        I am giving the sql I used, TableName is "LogTable" DateField is "StationTime" SELECT * FROM LogTable WHERE StationTime BETWEEN #6/25/2001# And #6/27/2001# . In the DataBase I am having Records with Dates ranging from 6/25/2001 to 6/27/2001.I am getting Records with date 6/25/2001 .But could not get the Records with date 6/27/2001. Hope I am clear. Thanx for the Response. Regards, yamini

        L 1 Reply Last reply
        0
        • Y yamini

          I am giving the sql I used, TableName is "LogTable" DateField is "StationTime" SELECT * FROM LogTable WHERE StationTime BETWEEN #6/25/2001# And #6/27/2001# . In the DataBase I am having Records with Dates ranging from 6/25/2001 to 6/27/2001.I am getting Records with date 6/25/2001 .But could not get the Records with date 6/27/2001. Hope I am clear. Thanx for the Response. Regards, yamini

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You can try #6/27/2001 23:59:59#. I think the default value of time is 6/27/2001 0:0:0.

          Y 1 Reply Last reply
          0
          • L Lost User

            You can try #6/27/2001 23:59:59#. I think the default value of time is 6/27/2001 0:0:0.

            Y Offline
            Y Offline
            yamini
            wrote on last edited by
            #5

            Yes.Thanx for the idea.I included the time along with date.Now it works perfectly.I am getting all the required records with the lower and upper date bound.The problem is solved. Regards, yamini

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups