Click here to Skip to main content
15,891,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here are the parts of My Program.

Table:SGinfo
-Birthdate
-Age
VB.net form
Label6.text Respectively "Update Age of all Guards in the list"


My question in my Database there is a record in the table that contains this ---> "7/25/2013"
How can i update a persons age by comparing only the Month and Day of the record in the databse in the Systems Month and Date also


Example
"7/15" Compare to database record like this "7/25/2013"


I dont know how to code this.

So please give a simple code about it TY.
Posted
Updated 28-Feb-18 22:01pm
v2
Comments
Sergey Alexandrovich Kryukov 25-Jul-13 0:37am    
There is no such thing as "VB.NET date".
—SA
Crixalis Paul 25-Jul-13 1:33am    
I already improve it sir

1 solution

select your required Date formate from sqlserver with the following query
compare it any date in vb.net like the follwing
VB
dim today as string=DateTime.Now.Date.ToString("mm/dd")

here is query
SQL
select convert(varchar,datepart(month,getdate()))+'/'+convert(varchar,datepart(day,getdate()))

compare the today variable and query output
i think this will help you
 
Share this answer
 
Comments
Crixalis Paul 28-Jul-13 5:54am    
Sir can this be apply on Microsoft Access Database?
Zafar A khan 29-Jul-13 0:25am    
for Ms Access you cant use format slightly different visit the following
http://databases.about.com/od/accessfunctionlibrary/a/functiondatepar.htm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900