Forum Replies Created

Viewing 15 posts - 8,881 through 8,895 (of 15,381 total)

  • RE: Search table field with LIKE clause

    kk1173 (3/28/2013)


    discharged_entered is a date field.

    Then forget all the convert nonsense. Just compare it to a datetime.

    c.discharge_entered_dt >= DATEADD(DAY, -14, getdate())

  • RE: Search table field with LIKE clause

    Why are you using the following code?

    c.discharge_entered_dt>=convert(varchar(10),getdate()-14,101)

    What is the datatype of discharge_entered? You do know that character evaluations will not produce the same thing as datetime evaluations. If your datatype...

  • RE: foreign key against multiple primary key constraint

    KoldCoffee (3/28/2013)


    Can there be an FK for a single column referencing only one column of a multiple primary key constraint?

    eg. one table contains two columns (posid, empid) which...

  • RE: SQL Logical errors

    That was pretty close. There are a few foreign keys to tables we don't have but that is workable. We are still missing tbl_DISTRICT_MASTER. And more importantly we still don't...

  • RE: SQL login Timeout expired .

    OK something has done something to your server. The fact that IPCONFIG and PING are not recognized suggests your path has been modified by something.

    This article http://www.opal-rt.com/kb-article/ipconfig-not-recognized explains how to...

  • RE: SQL login Timeout expired .

    Is it only for one user or all users?

  • RE: SQL login Timeout expired .

    --misread the previous post--

  • RE: SQL Logical errors

    sundayose (3/28/2013)


    How do I generate the DDL for entire my Database?

    Thanks for the responses.

    You don't need the entire database, just the few tables in your query.

  • RE: SQL Logical errors

    sundayose (3/28/2013)


    I think what I need is a tutorial which will teach me on how to join multiple table.

    Most of the tutorials I am getting on the internet do not...

  • RE: how to group using cases

    astrid 69000 (3/28/2013)


    Bad news :crying:, it doesn’t work in every scenario. Neither of the queries. I tried changing the numbers and it only worked some times.

    It divides the total weight...

  • RE: SQL Logical errors

    Lynn Pettis (3/28/2013)


    Just another reason to use table aliases in your code, Microsoft has deprecrated 3- and 4-part naming conventions in the select list. These will not be supported...

  • RE: sql query count()

    Like this?

    sum(case when ProductType = 1 then 1 else 0 end)

  • RE: how to group using cases

    astrid 69000 (3/28/2013)


    of course that works and i was nowhere close to the answer :w00t:

    but of course it worked 😀

    now the million dollar question... the way i did it, how...

  • RE: select case with multiple

    Your issue is here...

    WHEN @status = NULL THEN NULL

    That will never evaluate to true. You should instead use

    WHEN @status IS NULL THEN NULL

  • RE: SQL Logical errors

    The formatting of this makes my eyes bleed. Let's start by cleaning this up a little bit so it is easier to read.

    SELECT DISTINCT [dbo].[tbl_VOUCHER_ISSUE].dt_VOUCHER_ISSUE_DATE AS IssuanceDate

    ,[dbo].[tbl_VOUCHER_ISSUE_DETAIL].str_BARCODE

    ,[dbo].[tbl_SALES_TEAM_MASTER].[str_SALES_TEAM_NAME]

    ,[dbo].[tbl_VOUCHER_CAPTURE_DETAIL].str_BARCODE AS VouchersSold

    ,[dbo].[tbl_VOUCHER_CAPTURE].dt_VOUCHER_ISSUE_DATE AS...

Viewing 15 posts - 8,881 through 8,895 (of 15,381 total)