Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Courses > Access > Expert > X28 > < X27 | X29 >
Back to Access Expert 28    Comments List
Upload Images   Link   Email  
DateTime Concatenation
Austin Ritner 
    
4 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 
            
4 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 OP 
    
4 years ago
I'll give it a try later and let you know.
Richard Rost 
            
4 years ago
Remember, you can do it all in one statement, but it's easier if you break it down into steps.
Austin Ritner OP 
    
4 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 
            
4 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 OP 
    
4 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 
            
4 years ago
Awesome!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Expert 28.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

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
PCResale.NET
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
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 12/13/2024 4:14:21 PM. PLT: 1s