Viewing 15 posts - 61 through 75 (of 88 total)
Is this the format that you want your information?
header line of column names
data
data
data
footer line of column summary data?
Try this:
select 1, 'FieldOneName', 'FieldNameTwo', 'FieldNameThree'
union
select 2, convert(varchar(), FieldOne), , convert(varchar(), FieldTwo), ,...
July 13, 2005 at 11:33 am
Can you use two pieces of data instead?
Use select convert(varchar, @yourDateVariable, 1) to get the date
Use select datepart(hour,(@yourDateVariable)) to get the hour.
If you can only compare to one field,...
July 13, 2005 at 8:29 am
Your substring() should return a 6 digit number, starting at space 5.
Is all of your event_num data in that format?
You might try to test if the data is correct using...
July 12, 2005 at 11:10 am
What is the code that you are running that generates this error message?
July 6, 2005 at 11:05 am
What is the code that you are running that generates this error message?
July 6, 2005 at 10:49 am
Familiarize yourself with the SQL function isnull().
When comparing a field which may have a null value, instead of = CustomerID
use = isnull(CustomerID, '')
which means: If the customerid is null,...
June 3, 2005 at 9:36 am
Use the isnumeric function, to select only those reference numbers that can be converted to numbers.
Insert Into #Temp(RefNo)
select refno from Table
where isnumeric(refno) = 1
May 19, 2005 at 10:46 am
Oops!
I do apologize. I left out the crucial GROUP BY ResJoinID.
This is what is needed:
Join
(select ResJoinID, max(ChangeDate) as LatestDate
from SAVA.SAVA_SAVDJN
GROUP BY ResJoinID
)...
May 19, 2005 at 10:37 am
Do you have any triggers firing on updating your Employee table? That would really slow performance down to a crawl.
May 18, 2005 at 3:30 pm
has the other server been set up as a linked server?
May 18, 2005 at 3:28 pm
Here's a much smaller teaser.
READ this code.
print 'hello, David'
/*
go
print 'hello, Allen'
go
*/
print 'Goodbye, All'
Before running it, see if you can anticipate what the results will be. You'll be surprised.
May 18, 2005 at 1:39 pm
Here's how to group the data by half hour. Use datepart to isolate the hour, and again to isolate the minutes. Group the minutes by using a case statement to...
May 18, 2005 at 11:08 am
Let's reorganize the logic here. We need to limit the results to the latest date for each member, so we will use a derived table as a sub-query. I've added...
May 17, 2005 at 2:19 pm
DatePart returns a number, not a string. Use convert to change the datepart to a string.
SELECT convert(varchar(4), DatePart(year, datefield))
+ '-'
+ convert(varchar(2), DatePart(month, datefield))
Let...
May 17, 2005 at 2:02 pm
Your parameter @SQL becomes one string;
even though print @sql returns the value 'LMTO','MMAG', that value is stored in memory as the equivalent of "'LMTO'',''MMAG'", and does not...
May 17, 2005 at 10:56 am
Viewing 15 posts - 61 through 75 (of 88 total)