semangat….

buat semua yang kau cintai………….

Bagaimana mendapatkan tanggal kemarin di SQL server

SELECT CAST(DATEADD(d,-1,GETDATE()) AS DATE) AS Yesterday
SELECT CONVERT(CHAR(10), DATEADD(d,-5,GETDATE()), 120) AS Yesterday
SELECT REPLACE(CONVERT(VARCHAR, DATEADD(dd, -1, GETDATE()), 102), ‘.’, ‘-‘)

SELECT CONVERT(varchar, DATEADD(d,-1,GETDATE()), 110)
SELECT CAST(DATEADD(d,-1,GETDATE()) AS DATE) AS ‘DATE’
SELECT CONVERT(VARCHAR, DATEADD(d,-1,GETDATE()), 110) AS Yesterday

2013-10-24

2013-10-20

2013-10-24

10-24-2013

2013-10-24

10-24-2013

October 25, 2013 - Posted by | SQL |

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: