Forum Replies Created

Viewing 15 posts - 991 through 1,005 (of 1,217 total)

  • RE: Handling DIV ZERO Hell in MS SQL MSDE Query

    Nice stuff, Damien... well, I suppose that's the question that should have been asked first. I only tried to optimize existing code, without venturing deeper into the idea.

    What do YOU...

  • RE: Handling DIV ZERO Hell in MS SQL MSDE Query

    Well, yes, but he is doing divide by SUM... so the error should occur only if the entire SUM  = 0. This could occur either if there are no records...

  • RE: Handling DIV ZERO Hell in MS SQL MSDE Query

    As I understand it, you have problems when there are no records to be summed in the rep table. If so, then I would propose to check only after the...

  • RE: TOP 3 Kinda?

    If your table has a single-column primary key (column pk in the following SQL), then it should be simple:

    /*fictitious table for testing*/

    CREATE TABLE tbl (pk int identity primary key, category int,...

  • RE: Yet another simple question

    ... or maybe a simple LEFT(mrwid,1) <> 'R' would do the trick? Possibly with some treatment of NULL values, depending on what your needs are and whether NULLs are allowed.

    /edit/...

  • RE: select query with NOT in it??

    You can use NOT in queries, especially in connection with other keywords: IS NOT NULL, NOT EXISTS, NOT BETWEEN. But if you simply want to say "is not equal to",...

  • RE: help with SQL compare/update

    If you can't use triggers and want to record all changes to Employer, you could first record current values of ClientNo/RespEmployer - for ALL clients - in the table B as a...

  • RE: SQL Query to Create View

    Hello,

    it would be much easier to help you if you state what is the desired result, and in which way your SQL "does not work" in cases where the line...

  • RE: Problem with a TSQL statment with Subquery

    ... oh, and one question.. What is result of this : 

    SELECT count(*) FROM ft WHERE fno=6096

    SELECT count(*) FROM ml WHERE adoc=6096

    I supposed that adoc may occur twice, but fno is unique...

  • RE: Problem with a TSQL statment with Subquery

    Hi Luis, Bookkeeping means the same as Accounting... well, maybe there are some differences, but I don't speak English good enough to know them.

    It would really help a lot if...

  • RE: Problem with a TSQL statment with Subquery

    Bookkeeping is a strange thing and I never really understood it... but one thing I remember: most bookings are in pairs. That could be the reason of doubling 2554.51 to...

  • RE: retrieving the longest field length in a table

    To retrieve the entire row which has longest name:

    SELECT *

    FROM YourTable YT

    WHERE LEN(YT.Column_1) = (SELECT MAX(LEN(Column_1)) FROM YourTable)

    It will display all matching rows, if several rows have the same length...

  • RE: help with a query

    Remi, I absolutely agree with you that this would be the right thing to do... and somehow I'm afraid that not only this one table requires normalization.

    So, to make sure...

  • RE: help with a query

    Hmm.. I don't know, Remi... it seems they have their own business logic, with months absolutely independent on real calendar maybe setting things...

  • RE: help with a query

    I understand a bit more now... it is rather unfortunate solution to have "issue" instead of a simple datetime column. Is it the same in every year, that is, the...

Viewing 15 posts - 991 through 1,005 (of 1,217 total)