Viewing 15 posts - 2,446 through 2,460 (of 3,544 total)
One way is put the results into a temp table first with an IDENTITY column and then select based on the value of the IDENTITY column.
Far away is close at hand in the images of elsewhere.
Anon.
December 20, 2004 at 5:31 am
SELECT S.fldSubscriptionsSubscriberlastname & ", " & S.fldSubscriptionsSubscriberfirstname AS Expr1,
S.fldSubscriptionsSubscrno,
SA.fldSubscriptionsAddressesEffdate,
SA.fldSubscriptionsAddressesHouseno,
SA.fldSubscriptionsAddressesStreetname,
R.fldRoutesRouteno,
P.fldPublicationsName
FROM ((tblSubscriptions S
LEFT JOIN
[SELECT SA2.fldSubscriptionsAddressesSubscrno,
MAX(SA2.fldSubscriptionsAddressesEffdate) AS fldSubscriptionsAddressesEffdate
FROM tblSubscriptionsAddresses AS SA2
GROUP...
Far away is close at hand in the images of elsewhere.
Anon.
December 20, 2004 at 3:57 am
How about this
CREATE TABLE #TableB (GroupID int, [ID] int)
DECLARE @groupid int, @id int, @max-2 int, @ct int
SELECT @max-2 = MAX([ID]) FROM [TableA]
SET @groupid = 0
SET @id...
Far away is close at hand in the images of elsewhere.
Anon.
December 13, 2004 at 7:18 am
If you want to use cursor with dynamic sql then try this
DECLARE @sql nvarchar(4000)
SET @sql = 'DECLARE mycurs CURSOR FOR SELECT col,col,col FROM '
EXECUTE sp_executesql @sql
OPEN mycurs...
Far away is close at hand in the images of elsewhere.
Anon.
December 13, 2004 at 6:23 am
SELECT nc.id_doc AS [ID],
n.publish_date,
n.publish_time,
n_content.title,
n_content.abstract,
n_content.lead,
n.image_title,
n.image_main,
st.daily_stats
FROM (
SELECT doc_id,
SUM(doc_view_stats.hour_00 + doc_view_stats.hour_01 + doc_view_stats.hour_02 + doc_view_stats.hour_03 + doc_view_stats.hour_04 + doc_view_stats.hour_05
+ doc_view_stats.hour_06...
Far away is close at hand in the images of elsewhere.
Anon.
December 6, 2004 at 7:15 am
I use a tip from Antares to generate my Invoice numbers and use a control record
e.g
UPDATE ControlRecord
SET @InvoiceID = InvoiceID = InvoiceID + 1
WHERE ControlID = 1
SET @ErrorNo = @@ERROR
IF @ErrorNo <> 0...
Far away is close at hand in the images of elsewhere.
Anon.
December 6, 2004 at 6:59 am
| Btw, I am younger than you... |
With age comes wisdom. ![]()
| wouldn't it make this fora a bit more personell to make it mandantory for posters who crossed the... |
Far away is close at hand in the images of elsewhere.
Anon.
December 6, 2004 at 6:19 am
Based on your post
@resQuery must be a select statement
Following the INSERT @@ROWCOUNT will contain the number of rows inserted
When you say that it is always zero, how do you know,...
Far away is close at hand in the images of elsewhere.
Anon.
November 29, 2004 at 6:45 am
| Regarding the funnies, I will take them in the spirit they were meant (I hope) |
Helen,
The humerous anecdotes...
Far away is close at hand in the images of elsewhere.
Anon.
November 29, 2004 at 2:15 am
CASE WHEN start_date < '2004-05-01'
THEN '2004-05-01'
ELSE Dateadd(month,6,start_date)
END AS [anniversary]
Far away is close at hand in the images of elsewhere.
Anon.
November 26, 2004 at 4:50 am
Collation is set during installation of sql server and determines the collation for the system databases (eg master, tempdb) and the default for any created databases thereafter.
You can override the...
Far away is close at hand in the images of elsewhere.
Anon.
November 24, 2004 at 8:06 am
AJ,
If your interested this would be the solution using COALESCE
COALESCE(NULLIF(Col1,'HHHH'), Col2) AS [Result]
Far away is close at hand in the images of elsewhere.
Anon.
November 18, 2004 at 6:54 am
Viewing 15 posts - 2,446 through 2,460 (of 3,544 total)