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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to filter this kind of data ?

How to filter this kind of data ?

Scheduled Pinned Locked Moved Database
databasetutorialquestion
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.
  • C Offline
    C Offline
    cheeken2u
    wrote on last edited by
    #1

    My database table consists a Field (Called ApplyDate)store the integer data, like "20061122" represent 22 nov 2006. i need to filter the data for whole November 2006, but if i write SELECT....WHERE ApplyDate = 200611 , it cannot get the data out because the last two digit no specified. So , how i write the SQL Where statement if i want to select Whole Nov 2006 ? (for example, 20061101...20061130 also acceptable)

    Best regards, Chee ken

    A R 2 Replies Last reply
    0
    • C cheeken2u

      My database table consists a Field (Called ApplyDate)store the integer data, like "20061122" represent 22 nov 2006. i need to filter the data for whole November 2006, but if i write SELECT....WHERE ApplyDate = 200611 , it cannot get the data out because the last two digit no specified. So , how i write the SQL Where statement if i want to select Whole Nov 2006 ? (for example, 20061101...20061130 also acceptable)

      Best regards, Chee ken

      A Offline
      A Offline
      Anshuman Singh
      wrote on last edited by
      #2

      why dont you use like command example SELECT....WHERE ApplyDate like '200611%' this will give you proper result

      Anshuman Singh [anshumas@rediffmail.com](mailto:Anshuman Singhanshumas@rediffmail.com)

      C 1 Reply Last reply
      0
      • A Anshuman Singh

        why dont you use like command example SELECT....WHERE ApplyDate like '200611%' this will give you proper result

        Anshuman Singh [anshumas@rediffmail.com](mailto:Anshuman Singhanshumas@rediffmail.com)

        C Offline
        C Offline
        cheeken2u
        wrote on last edited by
        #3

        Thanks for your reply. I also have thinking using LIKE , but if the date is 20200611(11 Jun 2020 ), then my data is getting wrong already ! aLthough the date is many years later, but i just thinking have any other way to get the correct data, any idea ? thanks.

        Best regards, Chee ken

        1 Reply Last reply
        0
        • C cheeken2u

          My database table consists a Field (Called ApplyDate)store the integer data, like "20061122" represent 22 nov 2006. i need to filter the data for whole November 2006, but if i write SELECT....WHERE ApplyDate = 200611 , it cannot get the data out because the last two digit no specified. So , how i write the SQL Where statement if i want to select Whole Nov 2006 ? (for example, 20061101...20061130 also acceptable)

          Best regards, Chee ken

          R Offline
          R Offline
          Rob Graham
          wrote on last edited by
          #4

          "Where ApplyDate >= 20061101 and ApplyDate < 20061201"

          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