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 > TechHelp > Directory > Access > DatePart < Null Math | Parameter Query >
Back to DatePart    Comments List
Upload Images   Link   Email  
Problem with quotes in yyyy
Ester Grande 
     
11 months ago
Hi, i have been following your video all along, but I have a problem.
When in the query I write my calculated field

OrdiniAnno: DatePart("yyyy";[DataOrdine]) it automatically changes into

OrdiniAnno: DatePart("""yyyy""";[DataOrdine])

Even if I delete the extra quotes, it just put it back and of course the function doesn't work.

It happens  with yyyy and ww, for the others access put a \ before the single letter.

Basically it works only with "q" and "m".

Thanks
Juan C Rivera 
           
11 months ago
remove the ; and replace with , that will fix it.

V/r
Juan
Ester Grande OP 
     
11 months ago
Thanks Juan for your reply. Unfortunatly I had already tried but it doesn't work. If I put , instead of ; I get a syntax error with the , highlighted.

Any other suggestion?
Juan C Rivera 
           
11 months ago
I had to build a tale with the field DataOrdine. Added about five deferent dates,  not sure check the table and spelling
I made a query and used this code OrdiniAnno: DatePart("yyyy",[DataOrdine]) but it worked for me so I can't think of what may be causing your error.

last thought is the field a date field if not you mat need convert with CDate function

V/r
Juan
Ester Grande OP 
     
11 months ago
Thanks again Juan, table and spelling are correct, besides if they weren't correct neither "q" would work. Date field is a date
Juan C Rivera 
           
11 months ago
Sorry I could not help you.  

V/r
Juan
Kevin Yip 
     
11 months ago
You may need to use DatePart("aaaa"; ...) since Italian date format string is gg/mm/aaaa or g/m/aa (giorno, mese, anno = day, month, year) instead of dd/mm/yyyy or d/m/yy.  Your Windows language and regional settings determine these formats.  They also determine whether to use ";" or "," as separators.
Juan C Rivera 
           
11 months ago
Interesting!

V/r
Juan
Ester Grande OP 
     
11 months ago
Thanks Kevin. It worked. I didn't think of using italian in the code because it is all in english. That is very weird, but thanks again

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

 
 
 

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 3:40:25 PM. PLT: 2s