ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
sql server has its default date format in da form "yy-mm-dd"
its possible to convert da current date format of sql 
server to desired format. Now my question is dat how to get 
da previous and comin days date in my desired format??
 Question Submitted By :: Swapan
I also faced this Question!!     Rank Answer Posted By  
 
  Re: sql server has its default date format in da form "yy-mm-dd" its possible to convert da current date format of sql server to desired format. Now my question is dat how to get da previous and comin days date in my desired format??
Answer
# 1
Yes you can convert it through using
"select
convert(varchar(20),strDate,[1,2,3,4,5,6,101,102,103,104,105,106])"

diffrent diffrent code is present here you can try to use
all like
"select convert(varchar(20),strDate,101)"
where strDate is your date like "12/05/2008" or date from
database.Try it it will solve your problem.

Now second problem to get privious and cming date 
"select dateadd(dd,2,strDate)"
i used here dateadd function where dd is used for Day.you
can use MM for month and YYYY fro year also.After that I
gave 2,it is the number to increment in days ,month and
year.and in last i gave strDate

Now i want to get date before 2 days so i will right
"select dateadd(dd,-2,strdate)"

Hopw you will get your answers
 
Is This Answer Correct ?    1 Yes 1 No
Ritesh Parkhi
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is Report Server,Report Manager and Report Builder in SSRS 2005?  1
Please get the 4 th maximum salary from a table without using any sql keyword (TOP,MAX are mot allowed)  5
what are file groups? Evalueserve3
What is a deadlock and what is a live lock? How will you go about resolving deadlocks? Microsoft1
how to give input dynamically to a insert statement in sqlserver HCL2
what is the signification difference of this bit data type between sql 6.5 and later version sql server?  1
Which system tables contain information on privileges granted and privileges obtained  1
how can do you the system monitoring?  1
sql server has its default date format in da form "yy-mm-dd" its possible to convert da current date format of sql server to desired format. Now my question is dat how to get da previous and comin days date in my desired format??  1
What are the different types of backup avaible in SQL SErver Emphasis5
Which command using Query Analyzer will give you the version of SQL server and operating system?  3
what are the problems in logshipping?  2
What is ACID Property of Transaction?  4
syntax for deleting the database in T SQL  4
Can Having clause be used without Group by clause? CTS4
How do you find the number of rows in a table?  5
What are different types of Keys? Please explain all the keys with a suitable example.  2
What is Files and Filegroups in SQL Server & it's implementation. Zenith1
what is IDE,DMV in sql server? Value-Labs1
What is a NOLOCK?  3
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com