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 in Database by vnk
• 310 points
74 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 by Niroj
• 44,800 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
60 views
0 votes
1 answer

Find values in a comma separated string in a MySQL query

You can add commas to the left and ...READ MORE

answered Sep 10, 2018 in Database by Sahiti
• 6,290 points
6,640 views
0 votes
1 answer

How do I enable Oracle automatically on systemboot?

To enable the database service to start ...READ MORE

answered Oct 5, 2018 in Database by Frankie
• 9,810 points
90 views
0 votes
1 answer

Which operator is used in the query for pattern matching?

LIKE operator is used for pattern matching, ...READ MORE

answered Oct 15, 2018 in Database by DataKing99
• 8,150 points
717 views
0 votes
1 answer

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

To display the name of the employees ...READ MORE

answered Sep 26, 2018 in Database by Sahiti
• 6,290 points
173 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 26, 2018 in Database by Sahiti
• 6,290 points
1,574 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,810 points
1,046 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,100 points
91 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 in Database by Niroj
• 44,800 points
56 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 in Database by Niroj
• 44,800 points
46 views