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. Select Exact Day

Select Exact Day

Scheduled Pinned Locked Moved Database
question
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.
  • A Offline
    A Offline
    Agweet
    wrote on last edited by
    #1

    Hi...i have created a system that allows users to select process start dates and end dates, then they can select specific days for the process to run eg(Monday and Thursday), is there any possible way for me to get the exact date they specified eg: start date: 2008/09/10 and end date: 2008/09/20, they select Monday as specified date.. now is there a way to select the start date to be the first monday of the start date... scheduled dates: 2008/09/15 and 2008/09/18. Is there a wat to do this?

    living life on the flip side

    D 1 Reply Last reply
    0
    • A Agweet

      Hi...i have created a system that allows users to select process start dates and end dates, then they can select specific days for the process to run eg(Monday and Thursday), is there any possible way for me to get the exact date they specified eg: start date: 2008/09/10 and end date: 2008/09/20, they select Monday as specified date.. now is there a way to select the start date to be the first monday of the start date... scheduled dates: 2008/09/15 and 2008/09/18. Is there a wat to do this?

      living life on the flip side

      D Offline
      D Offline
      dojohansen
      wrote on last edited by
      #2

      Of course... SELECT DATEPART(dw, GETDATE()) AS 'Today' This gives you the day of the week (as an index), so if the first day is Monday (this is culture-dependent) the function returns 5 today, since today is Friday. So just test the start date and you'll know what day of the week that is. Based on that it's pretty easy to figure out how many days it is until any given day. :)

      A 1 Reply Last reply
      0
      • D dojohansen

        Of course... SELECT DATEPART(dw, GETDATE()) AS 'Today' This gives you the day of the week (as an index), so if the first day is Monday (this is culture-dependent) the function returns 5 today, since today is Friday. So just test the start date and you'll know what day of the week that is. Based on that it's pretty easy to figure out how many days it is until any given day. :)

        A Offline
        A Offline
        Agweet
        wrote on last edited by
        #3

        thnx for the reply...really works fine!! ;)

        living life on the flip side

        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