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

Explain cross join or cartesian product in sql?

698


List out what other servers you can use with ssrs?

115


How to convert numeric expression data types using the cast() function?

721


What should be the fill factor for indexes created on tables? : sql server database administration

816


What is the sql profiler?

689






What is the use of stored procedure?

662


What do you understand by recursive stored procedures?

745


What are points to remember while using the fillfactor argument?

714


What are the differences between INNER JOIN, LEFT JOIN and RIGHT JOIN in SQL Server?

795


What is right outer join in sql server joins?

847


What are null values in ms sql server?

756


Does an index slow down updates on indexed columns?

718


Explain throw statement in sql server 2008?

737


Define magic tables in sql server?

758


What is the difference between varchar and nvarchar datatypes?

761