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. Database & SysAdmin
  3. Database
  4. MSAccess

MSAccess

Scheduled Pinned Locked Moved Database
database
4 Posts 3 Posters 1 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.
  • N Offline
    N Offline
    nitin3
    wrote on last edited by
    #1

    I have a table Tab1 with fields Name and Dt( data type Date/Time). the col Dt have values 2/2/2007 3/3/2007 5/5/2008 i want to display names with date before 1/1/2008 i wrote the folowing query "SELECT Name from tab1 where dt < 1/1/2008" but this returns nothing.. iam using msaccess 2003. thanks

    M R 2 Replies Last reply
    0
    • N nitin3

      I have a table Tab1 with fields Name and Dt( data type Date/Time). the col Dt have values 2/2/2007 3/3/2007 5/5/2008 i want to display names with date before 1/1/2008 i wrote the folowing query "SELECT Name from tab1 where dt < 1/1/2008" but this returns nothing.. iam using msaccess 2003. thanks

      M Offline
      M Offline
      martin_hughes
      wrote on last edited by
      #2

      I think in Access you have to surround date/time literals with the # sign. Try:

       "SELECT Name from tab1 where dt < #1/1/2008#"
      
      N 1 Reply Last reply
      0
      • M martin_hughes

        I think in Access you have to surround date/time literals with the # sign. Try:

         "SELECT Name from tab1 where dt < #1/1/2008#"
        
        N Offline
        N Offline
        nitin3
        wrote on last edited by
        #3

        it worked thanks again !

        1 Reply Last reply
        0
        • N nitin3

          I have a table Tab1 with fields Name and Dt( data type Date/Time). the col Dt have values 2/2/2007 3/3/2007 5/5/2008 i want to display names with date before 1/1/2008 i wrote the folowing query "SELECT Name from tab1 where dt < 1/1/2008" but this returns nothing.. iam using msaccess 2003. thanks

          R Offline
          R Offline
          Rahul Goel
          wrote on last edited by
          #4

          Hello there, the correct query is here SELECT Name from tab1 where dt < #1/1/2008#

          Rahul Goel Microsoft Cerfied Solution Developer .Net Contact me at : rahul.g2510@gmail.com

          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