Forum Replies Created

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

  • RE: minus hours from current time

    select right(Convert(varchar(20),getdate()),7) will give the timepart of a datetime variable.

  • RE: Update SQL Statement

    U need to give necessary spaces between quotation marks and SQL keywords so that the SQL server can interpret them.

    If you dont give them properly especially in ASP. it is...

  • RE: save the stored procedure resultset to excel file with proper display in excel file

    U can write a simple .NET windows application and call urs stored procedure and send the result set to excel

    This is very simple.

  • RE: Use a database if exist

    Use the below script to find whether the database is there or not in a server

    if exists

    (select name from master..sysdatabases where name like '%abc%')

    Begin

    ...

  • RE: Find a change in address in a result set

    Let us take an example

    Create the table with the below structure (having an identity column)

    Create table Tbl_UserAddresses(

    Sno int identity(1,1),User int,UserAddress Varchar(50),ChangedDate datetime)

    Insert into Tbl_UserAddresses(User,UserAddress,ChangedDate)

    select 20,'abc','09/01/08' union

    select 21,'def','09/02/08' union

    select 20,'ghi','09/01/08' union

    select...

  • RE: return only the date from datatime

    select datepart(dd,getdate()) will give the only the date as 26

    select Convert(varchar(10),getdate(),101) will returns the date as '09/26/2008'

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