i use isqlw command to run a schedule batch file and generate an output to txt file. it will contain, header, header's line and data. how do i remove the header's line as this report will be open using Access and the line will be consider a row.
whta happen if it is run on sunday ??
"select cast('2003-09-28'as smalldatetime)-(datepart(dw, '2003-09-28') -2) , GetDate()"
if i schedule this script to run , it will not be able to run on Sunday
actually i understand what the right function for as u trim ur data from right to left with 2 space .... this function has help me as my records are month (1- 12), i need to sort it by the number, but it will be 1,11,12,2,3,4,5... so but adding a '0' to 1-9 it will be 01, ...09,10,11,12 ... then...
how do i apply this to my sql script as i am scheduling to run this sql script every day and i need to write sql script that can capture data from Monday to the day that i run the report, if the schedule report run on wed, then Mon to Wed, if on Sun then Mon to Sun
my current script example...
this is good ..
for "SET @iDAYS = datepart(dw,@myDATE)-2" does this mean i need to change the "2" when i am in another day ??
i am scheduling this script so that it will auto grabd the monday of that week and starting counting from mon to tues , mon to wed , and etc ... if...
thks ....i understand what u are doing ... u are actually put a '0' to the mycol and then use a right trim to take the back 2 only so if '1' then then '01'... if '12' then '012' and right trim will be '12' right ???
since i am using it as a date function , it will work as until month 12...
i am going a cummulative sql script where user want records daily. so they want the records cummulative from Monday to Sunday example, Monday to Tuesday, Mon to Wed and Mon to Thrus until Sunday ...
in oracle, we have the function called "next day (col , 'Monday') -1 " so that we can...
in sql server, what is the sql script or function to assign a '0' to number from 1-9 ?? example when output is 2 is should change it to 02. if 12 then it is 12
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.