RadhaKrishnaKiJaya
asked on
Need help with a query
Hi Experts,
I want to get the date in 'mmddyyyy' format the CURRENT_TIMESTAMP . I have an insert statement. The date '08042016' should come from the CURRENT_TIMESTAMP .
Thanks in advance.
INSERT INTO LOGINDETAILS
( UserID,
StdTimeIn,
TodaysDate
)
VALUES
( 1,
CURRENT_TIMESTAMP,
'08042016'
)
I want to get the date in 'mmddyyyy' format the CURRENT_TIMESTAMP . I have an insert statement. The date '08042016' should come from the CURRENT_TIMESTAMP .
Thanks in advance.
INSERT INTO LOGINDETAILS
( UserID,
StdTimeIn,
TodaysDate
)
VALUES
( 1,
CURRENT_TIMESTAMP,
'08042016'
)
using convert function with style 12 shall give format you want, something like convert(nvarchar(8),getdat e(),12)
ASKER
Hi,
Thank you for your reply. With convert(nvarchar(8),getdat e(),12) I am getting '160804 '. but I need '08042016'
Thanks.
Thank you for your reply. With convert(nvarchar(8),getdat
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. It worked!!