Viewing 15 posts - 2,446 through 2,460 (of 3,543 total)
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...
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...
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...
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...
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...
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... |
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,...
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...
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]
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...
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]
November 18, 2004 at 6:54 am
Self taught, mostly by practice and looking at samples and experience. BOL and web search helps and looking at forums like this one. This forum has a lot of articles...
November 16, 2004 at 2:08 am
Viewing 15 posts - 2,446 through 2,460 (of 3,543 total)