Forum Replies Created

Viewing 15 posts - 1,576 through 1,590 (of 3,008 total)

  • RE: Need to Calcualate 4 quarters from a given date

    shilpa726 (10/14/2009)


    Hi!

    I am working on a report and trying to calculate the previous 4 quarters from a given date. I need help! I am using Teradta SQL.

    Thanks.

    This forum is...

  • RE: Stored Procs and Unused Parameters

    GSquared (10/13/2009)


    I'd say go ahead and include them. It means a little extra RAM being allocated, but it doesn't hurt anything beyond that.

    It allows the dev to build a...

  • RE: Return Monthly results

    Bradley Jacques (10/13/2009)


    Hi!

    I'd love to help you, can you post the create table statements for the tables you will be using with this query? I've posted what I feel is...

  • RE: Stored Procs and Unused Parameters

    Ask the developer to explain exactly why that isn't a stupid idea.

  • RE: need to find date that the restored backup file was backed up on.

    Taking this a step further, you can see quite a bit of information about the backup it was restored from.

    select

    a.backup_start_date,

    a.backup_finish_date,

    Backup_Elapsed_Hours =

    convert(numeric(6,2),round(

    datediff(ms,0,a.backup_finish_date-a.backup_start_date)

    /(3600000.0),2)),

    Backup_Size_GB =

    convert(numeric(8,2),round(a.backup_size/(1073741824.),2)),

    Source_Server = a.server_name,

    Source_Database = a.database_name,

    Backup_File_Name =c.physical_device_name

    from

    msdb..backupset a

    join

    msdb..restorehistory b

    on a.backup_set_id...

  • RE: Timestamp issue

    GETDATE() returns the current local time that the database server is set to.

    If you need to deal with data from multiple timezones, you might use GETUTCDATE(). It returns the...

  • RE: need to find date that the restored backup file was backed up on.

    When you restore a backup from another server, the info about the backup you restored from is stored in the same tables where info about local backups goes:

    msdb.dbo.backupset

    msdb.dbo.backupmediafamily

  • RE: Select 1 day of data

    Garadin (10/12/2009)


    Michael Valentine Jones (10/12/2009)


    That is not a good method, since it means that datecol will be cast it an int and back to datetime for every row, and the...

  • RE: Select 1 day of data

    Garadin (10/12/2009)


    Neither, use this:

    SELECT * FROM Table1 WHER CAST(CAST(datecol-.5 as int) as datetime) =

    CAST('2009-10-01' as datetime)

    The dateadd/datediff method that someone will likely post shortly is almost identical, I just...

  • RE: Select 1 day of data

    Q1 is better, since it actually includes the whole day.

  • RE: very urgent please

    I like it when they mark it as urgent, and then post again an hour later complaining that no one is helping them.

  • RE: What do you think about SQLServerCentral.com?

    I usually only visit the forums, so I would like it if there were direct URL links for "Posts since my last visit" and "My Posts". I find it...

  • RE: sql maths:price / ? --> one decimal before the last digit

    select x= 000031761*0.1

    Results:

    x

    ---------

    3176.1

  • RE: SQL Server equivalent for PG Dump

    Use BACKUP and RESTORE. You can refer to SQL Server 2005 Books Online for detailed information on how to do this, starting with the link below.

    SQL Server 2005 Books...

  • RE: Combine Datetime

    select

    NewDate = dateadd(hour,a.TM/100,dateadd(minute,a.TM%100,a.DT))

    from

    ( -- Test Data

    select DT = convert(datetime,'2006-08-21'), TM = 1123

    ) a

    Results:

    NewDate

    -------------------------

    2006-08-21 11:23:00.000

    (1 row(s) affected)

Viewing 15 posts - 1,576 through 1,590 (of 3,008 total)