Viewing 15 posts - 301 through 315 (of 595 total)
I don't see a reason why not, however, I would suggest that the more verbose solution you had before might actually be a little more maintainable/readable, especially if your are...
June 19, 2003 at 6:35 am
With all the time we spent on this thread you probably could have just done 2 calls to the database, and used the results of the second call in your...
June 18, 2003 at 2:39 pm
OK, completely different strategy. What about this:
SELECT TOP 100 PERCENT
ISNULL(dbo.Defect_Data.UDL4, 'Unknown') AS WSI
, COUNT(dbo.Defect_Data.DataID) AS QDefectCount
, SUM(dbo.Defect_Data.SUMDEFECTS) AS DefectSum
FROM dbo.Defect_Data
WHERE (DATETIME >=...
June 18, 2003 at 2:24 pm
I forgot the FROM clause
try:
SELECT thismonth, thisyear, SUM(monthlysum)
FROM
(SELECT ... rest of code
sorry bout that one...
June 18, 2003 at 12:59 pm
Just be careful of addresses like "13 Barton Street #200". My solution would leave these types of records unaffected and rely on either a more complex where condition, or...
June 18, 2003 at 12:44 pm
Like I said, strip the time:
CREATE VIEW dbo.vwImport
AS
SELECT DATEADD(d, 0, DATEDIFF(DAY, 0, dbo.tblSHOrderItems.dteShipped)) AS dteShipped, dbo.tblSHOrderItems.txtInvNum, dbo.tblSHOrderItems.txtSuffix, dbo.tblSHOrdHead.txtCustomerPO,
SUM(dbo.tblSHOrderItems.intQuantity * dbo.tblSHOrderItems.curPrice) AS subtotal, dbo.tblSHOrdHead.curTaxAmt, dbo.tblSHOrdHead.pk,
SUM(dbo.tblSHOrderItems.intQuantity...
June 18, 2003 at 12:42 pm
quote:
To be more specific, I am trying to obtain the total of questionnaires in thequery per "WSI" as opposed to the percentage...
June 18, 2003 at 12:33 pm
-- St and Rd first
UPDATE MyTable
SET Address = SUBSTRING(AddressField, LEN(RTRIM(AddressField))-3, LEN(RTRIM(AddressField)))
WHERE RIGHT(RTRIM(AddressField, 3)) = ' St'
OR RIGHT(RTRIM(AddressField, 3)) = ' Rd'
I think you could use the...
June 18, 2003 at 12:28 pm
here's just a different variation:
SELECT DATEADD(d, 0, DATEDIFF(DAY, 0, GETDATE()))
June 18, 2003 at 12:22 pm
USE:
CONVERT(DATETIME, DATEDIFF(DAY, 0, GETDATE()))
to strip the time portion of the date.
Edited by - jpipes on 06/18/2003 12:20:51 PM
June 18, 2003 at 12:17 pm
In your last query, your are not grouping by the same number of columns you are trying to aggregate, so my guess is you are receiving an error saying "is...
June 18, 2003 at 12:11 pm
Don't do the CHAR(6) conversion. Not necessary. Try this:
SELECT thismonth, thisyear, SUM(monthlysum)
(
SELECT
DATEPART(MONTH, invodate) as thismonth
, DATEPART(YEAR, invodate) as thisyear
, ISNULL(SUM(docamnt), 0)...
June 18, 2003 at 11:47 am
ROCKO, not quite sure what you're going for here...
To set up a multi-column primary key, check BOL ALTER TABLE help article...gives examples of the ALTER TABLE ADD CONSTRAINT statement with...
June 18, 2003 at 11:20 am
It looks like a fairly clean trigger already. What you could do to make it a little less repetitive or verbose is declare some variables for the keyn, tbln,...
June 18, 2003 at 6:27 am
Hey, Tom, we had a good discussion about this back in November. Here's the thread on it; you might find some good opinions...
June 18, 2003 at 6:04 am
Viewing 15 posts - 301 through 315 (of 595 total)