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 write querry for expired date

how to write querry for expired date

Scheduled Pinned Locked Moved Database
databasetutorialsql-serversysadmin
3 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.
  • D Offline
    D Offline
    developerit
    wrote on last edited by
    #1

    hi, iam using sql server 2000 , the table fields are brabchid nvarchar(50), branchname nvarchar(50), companyid nvarchar(50), startdate datetime, enddate datetime 1)how to write a query to check that enddate is expired . 2)how to write a query to check that enddate is will expired after 10 days please give the example which helps me.

    M 1 Reply Last reply
    0
    • D developerit

      hi, iam using sql server 2000 , the table fields are brabchid nvarchar(50), branchname nvarchar(50), companyid nvarchar(50), startdate datetime, enddate datetime 1)how to write a query to check that enddate is expired . 2)how to write a query to check that enddate is will expired after 10 days please give the example which helps me.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Look into date function

      SELECT * FROM TABLE WHERE EndDate < GETDATE()
      SELECT * FROM TABLE WHERE DATEDIFF(d,Startdate,EndDate) > 10

      Never underestimate the power of human stupidity RAH

      D 1 Reply Last reply
      0
      • M Mycroft Holmes

        Look into date function

        SELECT * FROM TABLE WHERE EndDate < GETDATE()
        SELECT * FROM TABLE WHERE DATEDIFF(d,Startdate,EndDate) > 10

        Never underestimate the power of human stupidity RAH

        D Offline
        D Offline
        developerit
        wrote on last edited by
        #3

        thanks for code project team .it helps me alot...

        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