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 check this date is 6 months or 1 year for given condition

how to check this date is 6 months or 1 year for given condition

Scheduled Pinned Locked Moved Database
csharptutorialasp-netdatabasesql-server
2 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 asp.net with c# with sql server databae the table fields are username nvarchar startdate datetime enddate datetime paytype int reminder int while registering the user will selects the startdate and enddate and the pay type is 6months or 1year and he will select the reminder before 10days then if he selects for 6months then before 10days i have to send email. if he selects for 1year i have to send for every 6months before 10 days then how to write the querry for this condition please give the example which helps me.

    L 1 Reply Last reply
    0
    • D developerit

      hi, iam using asp.net with c# with sql server databae the table fields are username nvarchar startdate datetime enddate datetime paytype int reminder int while registering the user will selects the startdate and enddate and the pay type is 6months or 1year and he will select the reminder before 10days then if he selects for 6months then before 10days i have to send email. if he selects for 1year i have to send for every 6months before 10 days then how to write the querry for this condition please give the example which helps me.

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

      developerit wrote:

      then how to write the querry for this condition please give the example which helps me.

      You'll need to write a SELECT[^] statement, with a filter on the EndDate. You'd have to compare whether this EndDate equals "today" + 10 days. You can get todays date by using the GETDATE()[^]-function, and add 10 days using the DATEADD[^] function. Good luck :)

      I are Troll :suss:

      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