Solved

SQL Query question

Posted on 2013-01-17
2
240 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
Comment Utility
CAST(Round((DateDiff(d,id.DOB,'2012-11-01')/365.25),0)  as INT) as age
0
 

Author Comment

by:mig1980
Comment Utility
That worked like a charm. Thank you very much!!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now