Forum Replies Created

Viewing 15 posts - 1 through 15 (of 38 total)

  • RE: Convert Date For Comparison

    Something like this ...

    select datediff(minute,convert(datetime,'09:00:00'),convert(datetime,convert(char(8),getdate(),8)))

  • RE: SQL UDF to return hours

    A possibility (gotta go in a few minutes!)

    Calculating time diff  A->B using 0800-1600 only.

    Create a temporary table containing the following records
    A to 16:00
    08:00 to 16:00 for each day in between
    08:00...
  • RE: Need help to populate a column

    Rather late!  But here's another way of doing it ..

    declare @tab1 table (letter char(1))
    declare @tab2 table (letter char(1))
    declare @tab3 table (letter char(1))
    insert into @tab1 values ('A')
    insert into @tab1 values ('B')
    insert...
  • RE: T-SQL Output to Text File

    And ... as I've just remembered, there's another way which is much more friendly.  Edit the SQL Server Agent job.  Edit the job step.  Under "Advanced" there's the option to send the...

  • RE: T-SQL Output to Text File

    Another possibility is to use Data Transformation Services (DTS), which is part of SQL Server Enterprise Manager.  Theses jobs can be scheduled from within DTS.

    Michael

  • RE: non duplicate Rows

    A possible approach would be to read the data from each of the tables into one temporary table which has the name (or alias) of the source table as a...

  • RE: pls answer toi my date problem

    To avoid any ambiguity, I always try to enter the month as 3 letters, and show it in the same form on reports (some of which are sent to other...

  • RE: show all tables

    1st question ... select * from INFORMATION_SCHEMA.TABLES

    Michael

  • RE: Strange userdefined Function problem

    A bit late sending in a reply (been on holiday!)

    My approach to calculating working days is a bit simpler.  Holiday is a table containing the dates of all holidays.

    datediff(dd,convert(char(11),start_date),@end_date)
                         -...
  • RE: datetime query

    My memory must be somewhat hazy!  I managed to relocate the article - thanks to the computer having a better memory than me.

    http://support.microsoft.com/default.aspx?scid=kb;en-us;294350

    The bit about the upgrade is a...

  • RE: datetime query

    That's fine if you've got INFORMATION_SCHEMA.

    If you have upgraded your database in situ instead of starting from scratch you won't have it, and can't install those tables.  (Can't find the reference...

  • RE: select statement

    This syntax ought to work (haven't tested it!)

    sum(CASE 
          when dated >= '1-nov-1999' and dated < '1-nov-2000' then val
          else null
        END)  as y1999,
    
  • RE: datetime query

    select o.name, c.name
    from sysobjects o inner join syscolumns c on c.id = o.id
    where o.xtype = 'U' and c.xusertype = 61
    
  • RE: TimeSheet - Date Time

    This will work ... can probably be simplified

    declare @temp table (
     FEmpID int,
     FTime datetime,
     FType char(3)
    )
    insert into @temp values (
    210,    '2004-03-03 08:59:00.000',   'IN' )
    insert into @temp values (
    210,    '2004-03-03 19:10:00.000',   'OUT')
    insert into @temp values (
    210,   ...
  • RE: Julian to Calendar?

    Amending noeld's post ... is this what you mean?  I don't like 2 digit years!  The coding works only for the 21st Century.  It's fairly easily modified to handle a...

Viewing 15 posts - 1 through 15 (of 38 total)