Solved

SQL Query question

Posted on 2013-01-17
2
247 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 250 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

820 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