I need query based on Timestamp in sqlserver

0 votes
In Sql server: I have a fields Timestamp field (128365920). ID, Customer name. i need to based on Timestamp field.

How to write a query based on Timestamp Year, Month, Quarters, Days, Hours, Minutes  and include all fields,

Query output:

ID, Customer name, Timestamp, Year, Quarter, Day, Hour, Minitues, Sec

Please help on this query to importing to Power bi.
Jun 10, 2020 in Database by vnk
• 390 points
1,803 views

1 answer to this question.

0 votes

Hello  vnk,

To get some familiarity try creating and selecting a few TIMESTAMPS below.

 I was born on May 1st, 2020 at exactly 4:15am. so you fetch that timestamp bt the below query:

SELECT TIMESTAMP '2020-05-01 04:15:21';

And to add ID and customer name here is the query:

SELECT ID,customer name,TIMESTAMP '2020-05-01 04:15:21';

Hope it helps!!

Thank You!

answered Jun 30, 2020 by Niroj
• 82,880 points

Related Questions In Database

0 votes
1 answer

Things I need to consider before installing MSSQL on Linux

SQL server on Linux is pretty new ...READ MORE

answered Mar 17, 2019 in Database by Mohor
433 views
0 votes
1 answer

Difference between datetime and timestamp in sqlserver?

Timestamp is a synonym for rowversion, according ...READ MORE

answered Feb 16, 2022 in Database by Vaani
• 7,020 points
4,296 views
0 votes
1 answer

How to calculate age (in years) based on Date of Birth and getDate()

Following can be a solution to your ...READ MORE

answered Feb 23, 2022 in Database by Vaani
• 7,020 points
1,299 views
0 votes
0 answers

How to split a string of text in excel based on a given word?

I have a list of combinations of ...READ MORE

Apr 4, 2022 in Database by gaurav
• 23,260 points
250 views
0 votes
2 answers

Write a SQL query to find the names of employees that begin with ‘S’

Select ename From emp Where ename like"s%"; READ MORE

answered Oct 7, 2021 in Database by anonymous
25,466 views
0 votes
1 answer

What is the SQL query to get the third highest salary of an employee from employee_table

You can try out something like this: SELECT ...READ MORE

answered Sep 27, 2018 in Database by Sahiti
• 6,370 points
11,588 views
0 votes
1 answer

How to schedule a job for SQL query to run daily?

down voteaccepted Expand the SQL Server Agent node ...READ MORE

answered Oct 25, 2018 in Database by Frankie
• 9,830 points
9,788 views
0 votes
1 answer

Do I need to add primary key in each and every table?

Hi Shraddha, You have a doubt to add ...READ MORE

answered May 29, 2019 in Database by sampriti
• 1,120 points
1,152 views
0 votes
1 answer

How do I kill all the processes in Mysql “show processlist”?

Hello kartik, Mass killing operation saves time. Do it ...READ MORE

answered May 4, 2020 in Database by Niroj
• 82,880 points
2,234 views
0 votes
1 answer

Why do we need Transaction in Hibernate for read-only operations?

Hello @kartik, It doesn't matter whether you only ...READ MORE

answered May 4, 2020 in Database by Niroj
• 82,880 points
2,563 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP