Skip to content
Advertisement

Timeserial not recognized built in function in MS SQL

I am trying to implement an SQL query that gets records between today’s fixed timing 18:00 and yesterday’s fixed timing 18:00 based on a Date time column that I have in my table.

I tried this query

But, it’s throwing an error Timeserial is not a recognized built-in function name.

Any ideas please?

Advertisement

Answer

It would be best to use the DATEADD() function to add the time to the date you want. In this example, it subtracts 6 hours from the first number to get 18:00 yesterday, and then adds 18 hours to get 18:00 today.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement