Using a Parameter as a date but converting to timestamp

Lewis 21 Reputation points
2021-10-27T10:32:24.75+00:00

Good Morning,

I have a database table which stores a value called 'timestamp' this is simply a time/date converted to a number.

The formula used is:

=(B5-32874)*86400
Where B5 will be the Time / Date in this format:
06/02/2018 00:00:00

Currently on SSRS, I have to enter the timestamp as one of the parameters to select a from date, whereas I would like to be able to simply enter a date and time and then that gets converted into a timestamp for me when I run the query.

Is this possible?

Thanks

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,790 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Isabellaz-1451 3,611 Reputation points
    2021-10-28T02:21:18.157+00:00

    Hi @Lewis

    You can convert the timestamp to date,for example:

    I created a testTable
    144315-testtable.png

    Then use this query statement to convert the timestamp into date

    select DATEADD(s,datetimestamp,'1970-01-01 08:00:00') as pdate from testTable  
    

    Best Regards,
    Isabella


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments