which query u can write to sql server doesn't work
inbetween 7.00PM to nextday 9.00AM

Answer Posted / vimala

Declare @hour varchar(100)
set @time=convert(varchar,getdate(),114)
set @hour=SUBSTRING(@time,1,2)
if(convert(int,@hour)>8 and convert(int,@hour)<19)
begin
print @time
print @hour
end

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are click through reports?

99


How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?

566


Can sql server be linked with other servers like oracle?

526


Different types of keys in SQL?

634


Describe in brief system database.

545






What is plan freezing?

586


explain different types of cursors? : Sql server database administration

563


Once setting replication, can you have distributor on sql server 2005, publisher of sql server 2008?

596


What are the underflow and overflow behaviors on float literals?

578


How you provide security to cube? : sql server analysis services, ssas

539


What are scheduled tasks in sql server?

547


List types of tables in SQL Azure?

102


What is the new security features added in sql server 2016? : sql server security

620


What is query optimization process?

521


Explain primary key in sql server?

570