SQL/SSRS Date filter
Eliminate Pivot Table Annoyances
Likes Likes:  0
Results 1 to 3 of 3

Thread: SQL/SSRS Date filter

  1. #1
    Board Regular
    Join Date
    Dec 2008
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default SQL/SSRS Date filter

     
    Hi all

    Hopefully I have posted this in the correct forum.

    I am trying to create a report that shows who is off today. I have three fields that show the date_from the date_to and the Duration (in days)

    The issue I am having is where someone has taken the full week off for example 12/02/2018 to 16/02/2018 a duration of 5 days but the current date is in between them e.g. 13/02/2018. Is there a way of creating a calculation so that where the date difference between date_from and date_to is equal to the current date than return a true value else a false value?

    thanks
    Andrew

  2. #2
    Board Regular Kyle123's Avatar
    Join Date
    Jan 2012
    Location
    Leeds, UK
    Posts
    2,294
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)

    Default Re: SQL/SSRS Date filter

    Maybe:

    Code:
    SELECT * FROM your_table WHERE GETDATE() BETWEEN date_from and date_to

  3. #3
    Board Regular
    Join Date
    Dec 2008
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: SQL/SSRS Date filter

      
    Thanks very much works a treat

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com