Viewing 15 posts - 46 through 60 (of 67 total)
Use DateADD
Like:
declare @cur_date datetime
select @cur_date = GetDate()
print @cur_date
set @cur_date = dateadd(yyyy, 1, @cur_date)
print @cur_date
January 8, 2009 at 9:57 am
Part of my point here is to turn the OP to the direction of tally tables also.
I purposely have asked him to look at them.
Here is a simple way to...
January 7, 2009 at 7:18 pm
declare @STR varchar(20)
set @STR = 'HELLO WORLD'
select SUBSTRING(@str, 1,n)
from Tally t
where N<=LEN(@str)
The 'Tally' table is simple table of numbers.... pls look for...
January 7, 2009 at 6:58 pm
Your location variable does not change in the SP??
execute mysp_GetCurrentValue location, @nextid = @ilocationID output
can you execute this sp in a loop and print out the value of the out...
January 7, 2009 at 1:45 pm
Since I am obviously not able to see/recreate the problem, could the original poster confirm if using CTE
solves the problem. Like:
with myCTE(
somedata)
as(SELECT TOP 5 somedata FROM Table2 order by TransDate...
January 7, 2009 at 12:58 pm
Is this 2005 sql ??
when i tried your query:
SELECT somedata FROM Table1
UNION ALL
SELECT TOP 5 * FROM
(SELECT somedata FROM Table2 ORDER BY TransDate DESC)
I got an error but I...
January 7, 2009 at 12:39 pm
ok... makes sense...
Having ellipsis before the last page (if there are over ridden pages) would probably make it easier to understand.
January 6, 2009 at 2:24 pm
I am surprised that this is working.
This line looks strange...
select @range = 'Cells(' + cast(@currentRow as varchar(20)) + ',' + cast(@test1_col as varchar(20)) + ').Value'
Normally you get ranges by specifying...
January 6, 2009 at 9:01 am
Ranjit,
When we ask for sample scripts, we don't mean a copy paste of the first few lines of table.
This is what was required of you ...... (or something similar)
create table...
December 23, 2008 at 3:27 pm
1 Lakh = 100,000
1 Crore = 100 Lakh
In India, units change at hundreds and not at 1000s.
1 Million = 10 Lakh = 10,00,000
December 23, 2008 at 1:40 pm
I am glad I asked this question ... I had not thought of creating the unique constraint too... :w00t:
December 23, 2008 at 12:08 pm
Good point .... I had not thought of that
December 23, 2008 at 11:26 am
Jack Corbett (12/23/2008)
December 23, 2008 at 11:16 am
You are VERY close to what I am doing. I have a situation where one partner can be part of many partnerships.
And one partnership can have any number of partners...
So...
December 23, 2008 at 11:10 am
You need to alias your table in the from clause...
or you will get an error like
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "#voodo.column1" could not be bound.
December 19, 2008 at 5:03 pm
Viewing 15 posts - 46 through 60 (of 67 total)