Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
 
 
Microsoft Access Expert 28
By Richard Rost   Richard Rost on Twitter Richard Rost on LinkedIn Email Richard Rost   7 years ago


Back to Microsoft Access Expert 28
 

DateTime Concatenation Upload Images   Link  
Austin Ritner 
2 years ago
Could I concatenate a field consisting of how many days have passed since January 1st of that year, the current date/time and autonumber?

For example: 1/5/20 at 12:34:56 PM, and autonumber 12

Could I get that to display as 000412345612?
Richard Rost
2 years ago
Sure. I don't see why not. Use DateSerial to put together 1/1 of the current year. Use DateDiff to determine how many days from then until now. Use Format to assemble the current date/time as you want it. Then smash em all together. :)
Austin Ritner
2 years ago
I'll give it a try later and let you know.
Richard Rost
2 years ago
Remember, you can do it all in one statement, but it's easier if you break it down into steps.
Austin Ritner
2 years ago
Gotcha. Haven't quite learned about dateserial yet so that will be interesting. Formatting it should be either in the format tab or maybe an input mask with all numbers?

I'm thinking this could be an alternative to an OrderID and would probably only show on an invoice or paid orders.
Richard Rost
2 years ago
Just use the Format function. If you finish this entire class and still have questions, let me know. DateSerial is a great function.
Austin Ritner
2 years ago
Finally had some time to really work on this. It was super easy. The only thing I had an issue with at first was formatting the time because it was displaying the AM/PM, but as soon as I put Format([Time], "hhnnss") into the control source tab, it worked flawlessly.

So now it displays as days passed since 1/1, mmddyy, hhnnss, and autonumber (293)-(090920)(093342)(1)
Richard Rost
2 years ago
Awesome!

This thread is now closed. If you wish to comment, start a NEW discussion, below.
 


Back to Microsoft Access Expert 28
 

Start a NEW Conversation
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 

You may want to read these articles from the 599CD News:

5/16/2022Referential Integrity
5/15/2022Invoicing Member Discussion
5/13/2022Multivalued
5/12/2022Number Field Size
5/11/2022Create Word Document
5/11/2022Export to Word
5/10/2022On Click Event Timing
5/9/2022Invalid Use of Null
5/7/2022Event Handler
5/6/2022Database Title & Icon
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn