Calculating Age of Custoner in console Application

Posted by Premalatha under C# on 7/2/2012 | Points: 10 | Views : 1987 | Status : [Member] | Replies : 7
Hi,

I want to Display Date of Birth,E-mail of Customer, that will be store in Array,
So my problem is how to store special char in array like @ symbol and what to display date of birth like only MM/DD/YYYY.
When i using DateTime Date of Birth is giving O/P Like MM/DD/YYYY HH:MM:SS AM(By Default time);


Thank you,

Premalatha
Software Engineer



Responses

Posted by: Kamalakanta.Nayak09 on: 7/2/2012 [Member] Starter | Points: 25

Up
0
Down
Can you post your C# code here.

Thanks,
K.K

Premalatha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 7/3/2012 [Member] Silver | Points: 25

Up
0
Down
Hi,
You can select only Date Part From DateTime using the following method,
SELECT CONVERT(VARCHAR(10),GETDATE(),111)


For more details please refer,
http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/


Premalatha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Premalatha on: 7/3/2012 [Member] Starter | Points: 25

Up
0
Down
Im doing console application without database, i want just logic.

Premalatha
Software Engineer

Premalatha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 7/3/2012 [Member] Silver | Points: 25

Up
0
Down
Please try this
 Console.WriteLine(DateTime.Now.ToShortDateString());


Premalatha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 7/3/2012 [Member] Silver | Points: 25

Up
0
Down
You need to convert your datetime to 'ToShortDateString()'.
I think it will solve the problem...

Premalatha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 7/4/2012 [Member] Silver | Points: 25

Up
0
Down
Hope you solved that...
Please let me know,if anything more required.

Premalatha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 7/31/2012 [Member] Silver | Points: 25

Up
0
Down
Mark as answer if it helps...,That motivates...!!!

Premalatha, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response