Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
UpDate Query
Michelle Maughan 
      
4 years ago
Can someone tell me what I am doing wrong with this update query
Field: Numdays
Table: BookingT
Update To: [DepartureDate]-[ArrivalDate]

The result i get in BookingT is [2eparture2ate]-[Arrival]

I know its probably something silly i have forgotten, but i can't work it out.
Michelle Maughan OP  @Reply  
      
4 years ago

Adam Schwanz  @Reply  
           
4 years ago
Try using DateDiff in the update to.
Adam Schwanz  @Reply  
           
4 years ago
Also, both those fields are in that table, right? and are date fields?
Adam Schwanz  @Reply  
           
4 years ago
Also Also, this is something that could probably just be left as a query calculation and not need to be a value stored in the table. Unless you have some reason to do so :P.
Michelle Maughan OP  @Reply  
      
4 years ago
Yes both in the table and date fields.
I watched the DateDiff video and put DateDiff("d",[ArrivalDate],[DepartureDate]) in the Update to, but got the same result.
I need the number of days to calculate the cost.
Adam Schwanz  @Reply  
           
4 years ago
Try
CDate([DepartureDate])-CDate([ArrivalDate])
Michelle Maughan OP  @Reply  
      
4 years ago

Michelle Maughan OP  @Reply  
      
4 years ago
Still the same result
Adam Schwanz  @Reply  
           
4 years ago
Can we see the values of those two fields normally? Are they just a regular 10-28-2022 date? That makes me think it's either not seeing it as a date field or that the date field is formatted in a way it can't subtract or convert.
Michelle Maughan OP  @Reply  
      
4 years ago

Adam Schwanz  @Reply  
           
4 years ago
Also what type of field is NumDays?
Michelle Maughan OP  @Reply  
      
4 years ago

Michelle Maughan OP  @Reply  
      
4 years ago

Adam Schwanz  @Reply  
           
4 years ago
What is that format :P that's your problem
Adam Schwanz  @Reply  
           
4 years ago
Take that format \[d"eparture"d"ate]-[Arrival]" out all togethor
Michelle Maughan OP  @Reply  
      
4 years ago
Something definitely weird going on.
I change the date format back t dd/mm/yyyy.
The i checked Numdays format, very weird.
Just got rid of that hocus pocus and it is working.
Sorry to have wasted your time Adam.
Adam Schwanz  @Reply  
           
4 years ago
No problem :)
Michelle Maughan OP  @Reply  
      
4 years ago
How can that just randomly happen?
I certainly never put that in the format!!
Is this another "Evil Access Stuff"?
Adam Schwanz  @Reply  
           
4 years ago
That kind of stuff from what I've seen is usually just a freak accident user error. Maybe coding something with some typos and went to erase it and maybe hit some key to copy or paste it and that happened, or maybe accidentally drag and dropped some text somehow. Or maybe a combination of a few things, who knows, I've never seen it randomly change tables that have been around for a long time and aren't edited anymore though so I think it has to be some user/windows accident. I don't doubt you though that you didn't type that out purposely, that's a pretty random thing of characters haha.

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

Next Unseen

 
New Feature: Comment Live View
 
 

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 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/8/2026 1:55:41 PM. PLT: 0s