Viewing 15 posts - 271 through 285 (of 395 total)
It specifies the format of the convert (see help or Books On Line). Format 112 is YYYYMMDD so converting it to Varchar(6) just 'loses' the day. There are...
September 14, 2012 at 10:18 am
You can use:
WHERE Date > dateadd(yy, -1, getdate())
if you're using a DateTime field.
or
WHERE Date > CONVERT(Varchar(6), dateadd(yy, -1, getdate()), 112)
for "201209" format...
Note these are not very efficient for large data...
September 14, 2012 at 9:43 am
1: Works OK for me with the following issues:
declare @ColumnName varchar(50) --<< ERRORS ON THIS LINE<<
declare @sql nvarchar(max)
set @ColumnName = 'd_tid'
set @sql = 'select ' + @ColumnName + '...
September 14, 2012 at 6:48 am
Do you have any indexes on [tmp_load]?
It should speed up the joins if you created appropriate indexes
e.g. on dq_org_dist_id & dq_rec_seq_nbr.
September 14, 2012 at 5:04 am
Not so. You have to add a timestamp if you want one.
August 30, 2012 at 7:39 am
m.dunster (8/30/2012)
@Laurie - Thanks for this tweaked it to:
declare @time decimal(5,2);
set @time = 95.75
select replace(cast(convert(decimal(10,2),cast(@time as int)+(((@time-cast(@time as int))*.60))) as varchar),'.',':')
Which seems to work nicely
Thanks a lot.
Even better!
BTW - I...
August 30, 2012 at 7:36 am
declare @time decimal(5,2);
set @time = 95.25;
select cast(@time as int)+(((@time-cast(@time as int))*.60));
August 30, 2012 at 7:14 am
Try this. It uses Jeff Moden's 8K splitter - full details on this site...
declare @temp table
(
Sno int, Text1 varchar(200)
);
insert @temp values (1, 'Batch 58701, Sub -000 .');
insert @temp...
August 29, 2012 at 11:04 am
Something like this?
select char(ASCII('a') +1)
August 29, 2012 at 7:39 am
purushottam2 (8/29/2012)
I want to update in single query, other wise i have to use transaction and i can not use transaction.....
Why can't you use a transaction?
August 29, 2012 at 5:33 am
Golden rules of an interview:
Try to relax & enjoy it.
Listen carefully to questions - keep alert.
Show interest.
Have a list of questions to ask. Also ask questions/show interest in any...
August 29, 2012 at 4:39 am
Based on what we've got so far, this could be what you want:
--=======================================================
-- Test data:
--=======================================================
drop table #temp;
create table #temp
(
col1 int,
col2 char(1),
col3 char(1),
col4 char(3)
);
insert #temp values ( 1, 'X', 'M', 'abc'...
August 29, 2012 at 4:21 am
This looks easy enough to solve given a bit more information.
Can you post the queries that gave the results above, and if you posted some sample data you would most...
August 29, 2012 at 3:08 am
GSquared (8/28/2012)
CptCrusty1 (8/28/2012)
Laurie,Thanks for your reply. The "Values" reserved word didn't fly in 2005. Is that a 2008+ term?
Thanks
Crusty
That's what's called a "Table Values Function", and it's 2008+....
August 28, 2012 at 1:23 pm
Viewing 15 posts - 271 through 285 (of 395 total)