Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. robert030975

    Date Function Help

    Not pretty but does the trick ! SELECT CONVERT ( NVARCHAR (2) , GETDATE()-13 , 113) + '-' + UPPER (LEFT (DATENAME(MONTH,( DATEADD(Month, 0,GETDATE() ))) ,3))+ '-'+ DATENAME ( Year,GETDATE() )
  2. robert030975

    Date Function Help

    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 ) + '-' +...
  3. robert030975

    BCP [SQL Server Native Client 11.0]Unable to open BCP host data-file

    As a fix I Created a SQLAdmin account as admin and assigned the SQL service to it and hey presto it now works.
  4. robert030975

    BCP [SQL Server Native Client 11.0]Unable to open BCP host data-file

    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...
  5. robert030975

    Help Using Merge

    ...'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 (...
  6. robert030975

    Export a file with headers Help

    Thanks its a great help , still have to convert columns on the other side but great!
  7. robert030975

    Export a file with headers Help

    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...
  8. robert030975

    Default Constraint

    ...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...
  9. robert030975

    ROW NUMBER Partition by

    Hi by SequentialNumber ( I know its not great !)
  10. robert030975

    ROW NUMBER Partition by

    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...
  11. robert030975

    SQL Agent Job Start and Finish Time

    Is there an easy way to list what the SQL Agent job start time and finish time was ? Many Thanks
  12. robert030975

    Finding Information on a tape

    sure heres the script find /data/live /data/hist /data/informix /data/jvedi /data/live/compress -type f -print | tee $CPIOLOG | cpio -oc -C32768 -O $DEVICE
  13. robert030975

    Finding Information on a tape

    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...
  14. robert030975

    SQL Agent Job

    Hi Is there away of telling is a SQL user ran a SQL agent job manually if so where Thanks
  15. robert030975

    SQL Query Help

    My Bad I'm just being stupid ! Really appreciate the help though.
  16. robert030975

    SQL Query Help

    This sort of works but how would you handle if the S was on the 9th or 3rd?
  17. robert030975

    SQL Query Help

    yes sorry there are 7 days in week s m s t s w t f s s what i would like to see is only a group of s So m and t would be 1 whereas f would be zero.
  18. robert030975

    SQL Query Help

    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...
  19. robert030975

    SQL Query Help

    ...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...
  20. robert030975

    SQL Query Help

    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...

Part and Inventory Search

Back
Top