Viewing 15 posts - 121 through 135 (of 135 total)
Hariharan,
He doesn't say he wants the page number. Couldn't it be that the words go across two different pages?
Of course, it depends on the actual context of the query.
Your...
April 26, 2005 at 11:00 pm
Using a stored procedure doesn't stop people from having access to the table as well though. Although, in SQL2005 you can tell the stored procedure to execute to impersonate an...
April 26, 2005 at 9:46 pm
If you can't assume that wsequence is going to be x, x+1, x+2 in the case you want, then you might have to use a rownumber field on the table....
April 26, 2005 at 9:43 pm
If you store the 'met' field for each day, then could you rephrase what you're looking for as:
"Find an employee where there doesn't exist a 'not met' row between any...
April 25, 2005 at 10:33 pm
In SQL2005 with 'rownumber' introduced, you'll be able to do it without even thinking.
However, in SQL2000 you would need to make a rownumber function for yourself.
Look at http://support.microsoft.com/default.aspx?scid=KB;EN-US;q186133,...
April 25, 2005 at 10:27 pm
Then you've missed a space from what I wrote. Here it is with * instead of space.
Replace(Replace(Convert(Char(6),@thedate,109),'**','0'),'*','')
The concept is that you need to find the scenario where there are 2...
April 25, 2005 at 10:17 pm
Try this:
declare @thedate datetime
set @thedate = '4/25/05'
--set @thedate = getdate()
--set @thedate = '20050425'
--set @thedate = '20050401'
--set @thedate = '1-Apr-2005'
Select replace(Replace(Convert(Char(6),@thedate,109),' ','0'),' ','')
This is using a similar scenario, but first...
April 25, 2005 at 8:28 pm
Remove the space in
set @sql=('declare my_cur cursor for select ID, date from dbo. ' +@TABLENAME)
set @sql=('declare my_cur cursor for select ...
April 21, 2005 at 7:26 pm
> I do need to keep the loan type as is because that is what we use for the report.
Yes, but if you want count how many loans there are...
April 21, 2005 at 7:03 pm
Wow... when I need to pad in SQL, I just use the 'right' function.
SUBSTRING( DATENAME(month, '01/01/2005'), 1, 3) + right('0' + DATENAME( day, '01/01/2005'),2)
April 21, 2005 at 6:38 pm
I think you're mistaken here, Chris. If you create a cursor in an exec() statement, you can access it afterwards. Very handy thing, although I'm not sure it's actually by...
April 21, 2005 at 1:04 am
You can probably get around it by doing "count(distinct B.Loan_Nbr)" instead of "count(B.loan_type)"
Does this help?
April 21, 2005 at 1:02 am
Or if you are needing to group by, etc... ie, you can only order by the field that's in your select query, then convert it back to a datetime field!...
April 21, 2005 at 12:53 am
A few things...
You have an extra comma in the line:
set @sql=('declare my_cur cursor for select , ID , date from dbo. ' +@TABLENAME)
Try:
set...
April 21, 2005 at 12:45 am
Viewing 15 posts - 121 through 135 (of 135 total)