Forum Replies Created

Viewing 15 posts - 76 through 90 (of 429 total)

  • RE: TSQL - Minimum of numeric value

    Thanks to Kevin and all answers. 455 is good for this time.

    This table has another columns. I got to group by and get the minimum number. If I loop through...

  • RE: TSQL - Minimum of numeric value

    Remove all characters in data. You have only numeric value now. Get the minimum of that numeric value. Return corressponding value from the column.

    Data value  'AFGBS004SA55' is 00455

  • RE: Help with filtering data

    More rules are needed however try this.

    SET NOCOUNT ON

    DECLARE @Position TABLE

    (

    POS_NO VARCHAR(10),

    PC INT,

    MC INT,

    MS INT,

    MV INT

    )

    INSERT @Position

    SELECT '000114', 1, 2, 2, 0 UNION

    SELECT '000114', 1, 10, 0, 10 UNION

    SELECT '001596', 1,...

  • RE: Totalling Columns for report

    If it is classic asp you would have to go through a loop to diplay data in a grid. Better do it in the ASP.

    In asp.net if databind is used to datagrid,...

  • RE: help with CASE / Cross tab report

    DECLARE @orders TABLE

    (

    OrderID   INT,

    dateadded DATETIME,

    OrderDet  VARCHAR(100)

    )

    INSERT @orders

    SELECT 1, '01/01/2005', 'Det1'  UNION

    SELECT 2, '02/01/2005', 'Det2'  UNION

    SELECT 3, '03/01/2005', 'Det3'  UNION

    SELECT 4, '04/01/2005', 'Det4'  UNION

    SELECT 5, '07/01/2005', 'Det5'  UNION

    SELECT 6, '08/01/2005', 'Det6'  UNION

    SELECT 7, '01/05/2005', 'Det7'  UNION

    SELECT 8, '01/08/2005',...

  • RE: Finding and SHOWING duplicates

    Can we say one of the best.

  • RE: capture seconds in smaldatetime

    Change the field to datetime. In smalldatetime you already lost the sec information.

    DECLARE @myDate  DATETIME

    DECLARE @mySmallDate SMALLDATETIME

    SELECT @myDate = GETDATE(), @mySmallDate = GETDATE()

    SELECT GETDATE() myGETDATE,

     @myDate myDate,

     @mySmallDate mySmallDate,

     CONVERT(DATETIME, @mySmallDate) LostSecondsInSmallDate

  • RE: Finding and SHOWING duplicates

    I wouldn't do a string cocatenation for this. This will work for this as well.

    SET NOCOUNT ON

    DECLARE @Student TABLE

    (

    StudentID CHAR(7),

    FirstName VARCHAR(50),

    LastName VARCHAR(50),

    BirthDate DATETIME

    )

    INSERT @Student

    SELECT '1221144', 'Joe', 'Blow22', '11/25/1990' UNION

    SELECT '1221145', 'Joe', 'Blow22', '11/25/1990' UNION

    SELECT...

  • RE: Random Password Code - suggestions welcome

    hah ha Why didn't I thing about that.

  • RE: Need help with inner join

    As Sergiy said create a table with all fields and for calldata make a query

    SELECT name + '^' + address + '^' +...

  • RE: joining on most recent date

    Original poster said

    the join has to exist to, yes, the most recent, but yes, recent as per the purchase date. we don't want to reference an edition of...

  • RE: joining on most recent date

    If we assume product_id and date are unique.

    set nocount on

    declare @Prod table (Product_id varchar(10), product_update_date datetime, haha varchar(10), hihi varchar(10))

    insert @Prod

    select '0001', '05-Dec-2005', 'aaa', 'bbb' UNION

    select '0001', '01-Dec-2005', 'aaaa',...

  • RE: Random Password Code - suggestions welcome

    declare @cnt smallint

    declare @counter smallint

    set @counter = select min(id) from users

    set @cnt = (select max(id) from users)

    while @counter is not null

    begin

    update users set Password=left(replace(reverse(rand()),'.','0'),8) where id=@counter

    set NOCOUNT ON

    set @counter...

  • RE: Time Interval Summing

    set nocount on

    declare @myData table (mytime datetime, Calls int)

    insert @myData

    select '12/01/2005 00:00', 100 UNION

    select '12/01/2005 00:15', 200 UNION

    select '12/01/2005 00:30', 210 UNION

    select '12/01/2005 00:45', 250 UNION

    select '12/01/2005 01:00', 300 UNION

    select...

  • RE: Stored Procedure to Excel???

    create a dts package.

    select XLS object and connection object from left window.

    select a datatransfer task source is connection and destination is xls query is your sp. complete the rest of...

Viewing 15 posts - 76 through 90 (of 429 total)