Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)

  • RE: Need urgent help with query

    Hi

    Thanks a lot R. Brush.

    You are simply great. The query worked as required.

  • RE: Need urgent help with query

    Hi Thanks for the reply.

    Yes. from the query we need to remove 'and'.

    The column datetime1 in both the table is of type datetime.

    The values which are present are like '2013-02-04...

  • RE: Need urgent help with query

    Hi,

    Thanks for all your replies. Here is the query worked as required.

    select t.cardno ,dateadd(dd, -datediff(dd, t.datetime1, 1), 1) AS date,

    (select SUBSTRING(CONVERT(varchar, min(st.datetime1), 100), 13, 2) + ':' + ...

  • RE: Need urgent help with query

    Hi,

    Thanks for the reply.

    However, the select query gives the results as min of dateime1 and max of datetime1. The o/p which I want is like

    cardno, date, intime, outtime

    1111, 04-02-2013, 08:45,...

  • RE: Need urgent help with query

    Thanks for the reply.

    Here is the sql

    CREATE TABLE table1(

    [CARDNO] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

    [DateTime1] [datetime] NULL,

    [CHANNEL_NO] [smallint] NULL

    ) ON [PRIMARY]

    CREATE TABLE table2(

    [CARDNO] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

    [DateTime1] [datetime] NOT NULL,

    [action] [nchar](5)...

Viewing 5 posts - 1 through 5 (of 5 total)