Viewing 13 posts - 1 through 13 (of 13 total)
Yes Its more like an exercise and restriction made me think of using other options available, but not sure how to proceed.
May 23, 2016 at 10:47 pm
Actually below query raised this doubt:
Employee -- "Parent table"
Job -- "Child table" fields --> (Job_id, dept etc)
User --- "Child table" fields --> (user_id, loggedon)
Need to find employees currently...
May 23, 2016 at 12:41 pm
I achieved it proceeding like this
select startdate, case when startdate>=convert(datetime,'1 July '+convert(varchar,datepart(yyyy,GETDATE())))
then '1 Jan 1900' else startdate end Datecalc from MARKETSHARE order by Datecalc desc
anyway thanks all of...
May 28, 2014 at 2:31 am
Actually i am using this as a sub query inside my view, Declaring a date won't work because it should work for coming year records too..
May 27, 2014 at 1:21 pm
Hi ,
MarketShare<table>
StartDate || Rate
-------------------
22/06/2014 234
28/06/2014 789
29/06/2014 987
02/07/2014 890
i need latest start date record on july 1
Result :
StartDate || Rate
---------------------
29/06/2014 987
thanks in advance
May 27, 2014 at 1:10 pm
Jeff Moden (10/11/2013)
mynkdby (10/9/2013)
DECLARE @PARAMETER NVARCHAR(MAX)SELECT @P = 'MONDAY,SUN,FUN,D'
In order to help with this, you need to answer a serious question. Why must it be without a loop or...
October 11, 2013 at 7:02 am
Jeff Moden (10/6/2013)
J Livingston SQL (10/6/2013)
please see some code (still work in progress) below
the idea is to strip a csv column into separate columns:
the number of columns is indeterminate as...
October 9, 2013 at 3:36 am
J Livingston SQL (10/6/2013)
please see some code (still work in progress) below
the idea is to strip a csv column into separate columns:
the number of columns is indeterminate as is the...
October 9, 2013 at 3:34 am
Jeff Moden (10/6/2013)
mynkdby (10/4/2013)
and the code you have provided...
October 9, 2013 at 3:30 am
Pulivarthi Sasidhar (10/4/2013)
SET @STRSQL = 'SELECT ''' + REPLACE(@P,',',''' as Col,''') + ''''+' as lst'
OR
SET @STRSQL = 'SELECT ''' + REPLACE(@P,',',''' ,''') + ''''
If you...
October 4, 2013 at 7:19 am
Actually there can be any number of commas in between input parameter so in that only having 4 column thing is incorrect...
and the code you have provided that i am...
October 4, 2013 at 7:15 am
You can actually do like this just replace “,” with Single Quote & Comma & Single Quote will get you the answer. Along with that, we have to prepend “SELECT...
October 1, 2013 at 4:25 am
thanx keith that was a help
October 1, 2013 at 3:54 am
Viewing 13 posts - 1 through 13 (of 13 total)