Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOB

Status
Not open for further replies.

user222

Technical User
Nov 11, 2005
5
GB
trying to calculate DOB with no decimal place but its showing the decimal places. can anyone help?

using

=((Now())-([DOB]))/364
 
Convert it to integer.
Code:
CAST(((Now())-([DOB]))/364 as integer)
-- or
Convert(int,((Now())-([DOB]))/364)

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
just tried both these on my access form and I get (VALUE??)
 
Access doesn't allow the same commands as SQL, you should ask this in the Access forum.
 
in vba to cast to an int use CInt()

"Maturity is a bitter disappointment for which no remedy exists, unless laughter can be said to remedy anything."
-Vonnegut
 
thank you all. I have sorted it by using

=Int(((Now())-([DOB]))/364)
 
Glad you solved it, but you do need to post in the proper forum. This is for Microsoft's SQL Server.

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top