| |

VerySource

 Forgot password?
 Register
Search
View: 750|Reply: 5

Is there a function to get the date in sql?

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-4 17:00:01
| Show all posts |Read mode
The time of the database is 2016-12-12 16:04:42
I want to take only the date. Is there such a function? If not, what should I do?
Reply

Use magic Report

0

Threads

88

Posts

55.00

Credits

Newbie

Rank: 1

Credits
55.00

 China

Post time: 2020-5-17 22:00:01
| Show all posts
select convert (char (10), getdate (), 21)
Reply

Use magic Report

0

Threads

66

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-5-18 09:00:01
| Show all posts
getdate ()
Reply

Use magic Report

2

Threads

18

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-5-18 10:00:01
| Show all posts
select convert (char (8), getdate (), 112)
or
select convert (char (10), getdate (), 120)
Reply

Use magic Report

0

Threads

40

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-5-18 13:45:01
| Show all posts
lz check the online help search for ‘CONVERT’

There is a very detailed table of conversion methods in various time formats ^ _ ^
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-5-18 14:15:02
| Show all posts
select convert (char (10), getdate (), 120)
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list