![]() To get the current date, you use the CAST () function with the GETDATE () function as shown in the following statement: SELECT CAST ( GETDATE () AS DATE. However, it has another function named GETDATE () that returns the current date and time. SETDATE SQL CODEIN ( CASE '1' THEN ( SELECT REF_USER_ID FROM USERDETAILS where Ref_Gender_ID in (1 ) )Ĭan you please provide me an alternate solution? Thanks in advance. Code language: SQL (Structured Query Language) (sql) SQL Server does not support CURRENTDATE function. This is not permitted when the subquery follows =, !=,, >= or when the subquery is used as an expression. When I remove “TOP (1)” from sub-query, it returns more than one value and at that time I am getting the following error: “ Msg 512, Level 16, State 1, Line 4 IN ( CASE '1' THEN ( SELECT TOP (1 ) REF_USER_ID FROM USERDETAILS where Ref_Gender_ID in (1 ) )Ģ. SET = '1' //Paramter may be integer value or NULL. The below Query is working fine but only for the Top 1 Record: I need a solution for this without using dynamic query.ġ. I’m getting the following error: “ Msg 512, Level 16, State 1, Line 4 Please find the below Query which has case with mutiple return value. I'm new to SQL but need to learn fast as my job requires me. Is this the most recent SQL Server Website list? I noticed this was posted/updated last on 2015. SETDATE SQL UPDATE
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |