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. a query suing Time format

a query suing Time format

Scheduled Pinned Locked Moved Database
databasequestion
4 Posts 3 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, I want to know the row(s) in which a Time Field is = to 15h00 : I've tried this but it doesn't work. SELECT * FROM MyTable WHERE TimeField=#15:00# ; have you got an idea ? BrutalDeath0

    C P 3 Replies Last reply
    0
    • L Lost User

      Hi, I want to know the row(s) in which a Time Field is = to 15h00 : I've tried this but it doesn't work. SELECT * FROM MyTable WHERE TimeField=#15:00# ; have you got an idea ? BrutalDeath0

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Brutaldeath0 wrote: a query suing Time format I want to know the row(s) in which a Time Field is = to 15h00 I'm not a lawyer - but you could try for a John Doe lawsuit. ;P


      "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871)

      1 Reply Last reply
      0
      • L Lost User

        Hi, I want to know the row(s) in which a Time Field is = to 15h00 : I've tried this but it doesn't work. SELECT * FROM MyTable WHERE TimeField=#15:00# ; have you got an idea ? BrutalDeath0

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        Okay, it's been a long day... Here is a more serious answer.... SELECT * FROM MyTable WHERE datepart(hour, TimeField) = 15


        "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871)

        1 Reply Last reply
        0
        • L Lost User

          Hi, I want to know the row(s) in which a Time Field is = to 15h00 : I've tried this but it doesn't work. SELECT * FROM MyTable WHERE TimeField=#15:00# ; have you got an idea ? BrutalDeath0

          P Offline
          P Offline
          peterzorbas
          wrote on last edited by
          #4

          why not just use the LIKE clause. LIKE '15h00'. aren't dates stored as varchars, if not then you'd need to cast somehow. im just giving this advice from a programmers perspective

          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