[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL Query question

Posted on 2013-01-17
2
Medium Priority
?
260 Views
Last Modified: 2013-01-17
Good day. I am trying to use the following to round for an Age element but I get a number with 6 zeros after it.

Example: 14.000000

The quey is Round((DateDiff(d,id.DOB,'2012-11-01')/365.25),0) as Age

Any idea how I can get it so that it doesn't show the zeros?
0
Comment
Question by:mig1980
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 1000 total points
ID: 38789745
CAST(Round((DateDiff(d,id.DOB,'2012-11-01')/365.25),0)  as INT) as age
0
 

Author Comment

by:mig1980
ID: 38789805
That worked like a charm. Thank you very much!!
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question