question

Lewis-3995 avatar image
0 Votes"
Lewis-3995 asked Isabellaz-1451 edited

Using a Parameter as a date but converting to timestamp

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Isabellaz-1451 avatar image
0 Votes"
Isabellaz-1451 answered Isabellaz-1451 edited

Hi @Lewis-3995

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.




testtable.png (27.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.