I want to create a simple function that will take the datetime and convert it to
14-AUG-2013.
Now the current select works fine until we get to the start of the month
and it shows
1-AUG-2013
but is there any way to make it show
01-AUG-2103
SELECT DATENAME ( DAY, GETDATE()-13 ) + '-' +...
Hi trying to send a file to a folder and having a few issues !
SQL2012
Error = [Microsoft][SQL Server Native Client 11.0]Unable to open BCP host data-file
Exec master..xp_cmdshell 'bcp "select name from sysobjects" queryout "\\SERVERNAME\FileDrop\out.txt" -c -T -S'
I have also tried the...
...'Test' )
CREATE TABLE #tmp1
(
a_id INt IDENTITY(1,1) NOT NULL,
LDate Date NOT NULL ,
id INT NOT NULL ,
Tp NVARCHAR(25) NULL )
--Select * from #tmp
---- Method 1
MERGE #tmp1 AS DST --destination
USING #tmp AS SRC --source
ON (SRC.ID = DST.id)
WHEN NOT MATCHED THEN
INSERT (...
Hi having a little bit of an issue and wondered if its possible to do soemthing better??
so create table new_tbl (id int, basket varchar(10), Calc numeric)
insert into new_tbl
values (1, 'Test', 123.12)
, (2, 'Test', 456.78)
, (3, 'Test', 901.12)
My question is the only way...
...VARCHAR(50) CONSTRAINT df_customer_Add DEFAULT 'UNKNOWN'
)
If I insert
Insert into Customer
Values ( 113, NULL,NULL)
select * from Customer
The customer adress comes up as NULL as opposed to 'UNKNOWN'
I thought about specifying
CustomerAddress VARCHAR(50) CONSTRAINT...
HI
I'm in need of some help grouping some data
partNo Qualification SequentialNumber SortOrder Sets
877 Vehicle Equipment 10801 00003 1
877 To construction year 10801 00004 1
877 Block Separation 10801 00005 1
877 To construction year 10801 00006 2
877...
HI All
I was wondering if the following syntax
cpio -ivt -C32768 < /dev/st0 /data/jvedi/jv-ediinp
is the best way to find this file ( jv-ediimp) on my tape as its taking ages!! I also get the message
cpio: warning: skipped 9373909 bytes of junk
cpio: warning: skipped 594005 bytes of junk...
Ive joined it on to a calendar table but what condition can you use to select the 05/06??
NULL NULL 2011-07-03 00:00:00
NULL NULL 2011-07-04 00:00:00
DO 2011-07-05 00:00:00 2011-07-05 00:00:00
DO 2011-07-06 00:00:00 2011-07-06 00:00:00
NULL NULL NULL 2011-07-07 00:00:00
DO 2011-07-08 00:00:00...
...COLA, COLB, COLC
into #s1
from table
and CODE = ('DO')
select distinct COLA, COLB, COLC
into #s2
from table
and CODE = ('S')
Select * from #s1 a inner join #s2 b on a.COLa = b.colB-1
inner join #s2 c on a.fk_pemast = b.fk_pemast
and a.COLa = b.colB+1
Bit messy but does the trick...
I am sure this is easy but I'm really unsure in how to approach this
Col a Col B Col c
2011-07-03 00:00:00 B Y
2011-07-04 00:00:00 S Y
2011-07-05 00:00:00 DO N
2011-07-06 00:00:00 S Y
2011-07-07 00:00:00 DO N
2011-07-08 00:00:00 S Y
2011-07-09 00:00:00 B Y
What I need is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.