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


Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2003, 09:29 AM
BMan111 BMan111 is offline
Freshman
 
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.

Braden
Reply With Quote
  #2  
Old 09-15-2003, 09:42 AM
Timbo's Avatar
Timbo Timbo is offline
Green-Eyed

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

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
  #3  
Old 09-15-2003, 09:45 AM
SpaceFrog's Avatar
SpaceFrog SpaceFrog is offline
Contributor
 
Join Date: May 2003
Location: Newt Galaxy
Posts: 542
Default

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

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.

Braden
Reply With Quote
Reply


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-02-2002 12:26 AM
Shareware Registry Protection Technigue karachi999 General 2 01-21-2002 03:40 PM
Loop to format file kingesk General 2 09-10-2000 06:01 PM
File format problem kingesk General 1 09-08-2000 05:52 PM

Advertisement:





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.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
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..
subscribe
 
 
-->