Convert string to date in VB6
Hi all,
I am very new to VB6 and have something I can't seem to figure out. Help would be greatly appreciated!!!!
I have a field stored in the database as varchar6 in the yyyymm format. I need to add 18 months to this date and display the results on a vb6 form. Can someone help me with the code to do this?
Thank you in advance for you help.
Christine
Re: Convert string to date in VB6
VB's DateSerial can do the trick, using Left 4 chars as the year, Right 2 chars as the month, then supply 1 for the day. Use VB's DateAdd() function to add to a date variable as desired.