format 1 digit year

K

Kokanutt

I have a code that names a txt file with year and julian date before export.
the naming convention includes the current year. But I only need the last
digit of the year i.e. instead of VHMC200850.txt i need VHMC850. Where "8"
is the 1 digit year and "50" is the Julian date. But i only need the 8 until
2010 then i will need the two digit year. Also when i use just "y" i get the
serial number i.e. VHMC5050. Please advise. See codes below.

DoCmd.TransferText acExportFixed, "ACR Export Specification", "Qry1",
"C:\Documents\VHCN" & Format(Now, "yy") & ((DateDiff("d", Now,
DateSerial(Year(Date), 1, 1)) - 1) * -1) & ".txt", False .......this gives
VHCN0850
 
K

Klatuu

Why have to redo the form in less than 2 years. Just use the two digit year
for all months. It will also cause your file names in Windows Explorer to
sort in the correct order, otherwise it would be like:

1
10
11
12
2
3
4
5
6
7
8
9
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

TransferText 3
Access 2 Digit year in Access Text Box 3
Three Digit Julian Date 4
TransferTest 2
Date Formating 5
Return a 3 digit number 2
2 digit year 8
Strange Julian Date Phenomenon 9

Top