Viewing 15 posts - 13,306 through 13,320 (of 13,841 total)
It will be something to do with the structure of the tables and the way that you have joined them - there will probably be a many-to-many relationship somewhere that...
September 15, 2005 at 8:03 am
This grim-looking piece of code should get you heading in the right direction!
select id, col1, col2, col3, rtrim(left(col4, charindex('Departure',Col4)-1)) [Desc]
from table
union
select id, '', '', '', ltrim(right(col4, len(col4) - charindex('Departure',Col4)+2))
from table
order...
September 15, 2005 at 7:40 am
I can think of a query that will give you this, but it would depend on the display of the primary key in the table (for sorting - to keep the...
September 15, 2005 at 6:02 am
Aah! So you are trying to detect series of consecutive numbers that do not contain gaps?
So you want output like this:
Min Max Count
107 112 6
?
September 15, 2005 at 5:54 am
So you want the min, max and count, subject to a filter on the data that is being analysed? Like this?
select count(field), min(field), max(field) from table where field between 107...
September 15, 2005 at 5:03 am
If you always know the first few letters, you could try left(column,2) = 'aa' instead of like 'aa%'. An index on the column that you are searching will also help...
September 15, 2005 at 4:59 am
I suggest that you use a reporting tool (Access, Crystal etc) to achieve this sort of formatting. What are you going to do with the output?
Regards
September 15, 2005 at 4:11 am
I agree - DTS is the way to go. Why make things harder for yourself??
September 15, 2005 at 4:09 am
Difficult to tell from the way that the stuff's been formatted for display. What is the field delimiter (ie which character appears between the fields and nowhere else)?
September 15, 2005 at 4:07 am
I've had a quick look, but can't find where this alias is appearing - please direct me to it!
Phil
September 15, 2005 at 4:04 am
Wow, comprehensive answer! So there is a God and he understands SQL Server ... all is well ![]()
September 15, 2005 at 3:28 am
What message are you getting?
September 14, 2005 at 5:22 am
Not in SQL Server - but perhaps it's something to do with Magic Software ???, check out:
September 14, 2005 at 5:20 am
This appears to be a logon error - possibly because the external app is trying to log in as sa and the sa password has been changed on the server. ...
September 14, 2005 at 2:38 am
This gets you some of the way and may give you an idea about how to finish it off:
select b1.*, sum(b2.units) CumUnits
from basetable b1
join basetable b2 on b1.tdate >= b2.tdate
group...
September 13, 2005 at 8:12 am
Viewing 15 posts - 13,306 through 13,320 (of 13,841 total)