Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Word, PowerPoint, Outlook, and Other Office Products > String Help

Thread Tools Display Modes
Old 09-15-2003, 08:29 AM
BMan111 BMan111 is offline
Join Date: Jul 2003
Posts: 25
Default String Help

I need some help with something I know is overly simple, but just cant seem to find anywhere. I have a date stored in a field in Access 2k2. In VBA, I pull it into a string variable named DateOut. What I need to do pull the characters to the leftof the first '/', giving me the number of the month, and the two numbers after the last '/', giving me the year.

The point of this, if you were wondering, is that my client wants the date shown in a very specific way, and Access doesnt have a pre-determinded format for it. As such, I need these numbers to format the date correctly by some hand written code. Anyone know how to get these numbers for me, I'd be greatly appreciative.

Reply With Quote
Old 09-15-2003, 08:42 AM
Timbo's Avatar
Timbo Timbo is offline

Super Moderator
* Guru *
Join Date: May 2001
Location: Bangkok, Thailand
Posts: 10,261

Look up the 'InStr' and 'InStrRev' function in the VB help...
"He's not the Messiah. He's a very naughty boy!" - Brian's mum

Can't find the answer? >> Try something new!
Become a Professional
Reply With Quote
Old 09-15-2003, 08:45 AM
SpaceFrog's Avatar
SpaceFrog SpaceFrog is offline
Join Date: May 2003
Location: Newt Galaxy
Posts: 542

split would be another way to get there ....
Life is a beach !
Reply With Quote
Old 09-16-2003, 08:43 AM
BMan111 BMan111 is offline
Join Date: Jul 2003
Posts: 25

I ended up just backdooring it and using the Right and Left functions in Query Builder. Thanks for the input, I just didn't have the time to learn to use those.

Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting a file in dat question ? murphys General 5 11-06-2002 09:34 PM
Open an associated Text Document knoxitis General 19 05-01-2002 11:26 PM
Shareware Registry Protection Technigue karachi999 General 2 01-21-2002 03:40 PM
Loop to format file kingesk General 2 09-10-2000 05:01 PM
File format problem kingesk General 1 09-08-2000 04:52 PM


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..