473,890 Members | 1,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date formatting for calculations

33 New Member
Hi,

I've used a form to capture the requesters date range specifications for a set of queries forever and never cared that it took the short date entered by the requester and changed it to a number when it stored the date for later use.

Now I'm trying to subtract that number from a date supplied from a system database, which is in short date format, and the output looks like a short date instead of a number.

Can someone help me get a result that looks like the number of days between 2 dates instead of getting something that looks like a date?

Thanks,
Shawn
Jan 9 '08 #1
1 1415
puppydogbuddy
1,923 Recognized Expert Top Contributor
Hi,

I've used a form to capture the requesters date range specifications for a set of queries forever and never cared that it took the short date entered by the requester and changed it to a number when it stored the date for later use.

Now I'm trying to subtract that number from a date supplied from a system database, which is in short date format, and the output looks like a short date instead of a number.

Can someone help me get a result that looks like the number of days between 2 dates instead of getting something that looks like a date?

Thanks,
Shawn
One way is to use the DateDiff function. See this link:

http://www.techonthenet.com/access/f...e/datediff.php

Dim x as integer ' number of days

x = DateDiff("d", [Date1] , [Date2])
Jan 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5236
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much appreciated. TIA
22
1821
by: KsAdmin | last post by:
I have a question which has had me stumped for a few days now. I have a form that I add the values of fields together and display the total in a total field. I have the calculations working correctly. My problem is that I would like to change the format of the total from 1234567 to 1,234,567 . Is this possible using javascript? Here is the code that I use to do the calculations. I have edited out all the code that I use to validate the...
11
4691
by: lduperval | last post by:
Hi, I`m trying to do date calculations in three types of time zones: local, GMT and specified. The issue I am facing is that I need to be able to specify a date in the proper time zone, and I`m having a heck of a time doing so. I have created a form where I use drop downs do specify year, month, date, hour, minute and seconds. When the form is loaded, the dropdowns have to display the proper values for the current time zone type. This
2
7340
by: Joe Jax | last post by:
I have some date calculations that add a time span to a date. The problem is, when I add a time span that is a whole number of days to a date, the result can be +/- 1 hour due to daylight savings. Is there anyway to disable this?
2
3910
by: Eddy Bee | last post by:
Hi there, I'm encountering an inexplicable problem with page formatting in reports. Here's the easiest way to explain it: The Detail section of my report contains two elements: And let's say I have the following VB code for the Detail_Format event:
8
2119
by: Charlie Brookhart | last post by:
I am creating a program that involves having to find the difference between two dates and converting it to a number to be used for calculations. The problem is that the way it is setup, VB is not doing anything with the dates that I have selected. I hope that someone here can help me figure out why it is not working what I have to do to make it work. This the code I have for the date calculations. txtNumberOfDays.text =...
3
3323
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when the field should only be showing one or the other (date or time). Even on the back end of the database where the column properties are, I have chosen the smallest date/time formats. When the aspx page runs, it shows the date and time (ie:in a...
11
6377
by: tlyczko | last post by:
Hello, I'm new to SQL Server, working for a non-profit computerizing a lot of its data. I imported a table of people's names, birth dates, etc. into SS2005 from Access, and the birth_date was imported as an Access date/time field, giving it the datetime datatype in SQL. The column values look like: 10/14/1964 12:00:00 AM
9
2227
ShawnRR
by: ShawnRR | last post by:
Hi all, This program is an easy "printing" Calculator... the problem i am having is that when I type in "0e" or "0E" for the program to exit it thinks i am typing in an exponent value and does not exit unless i type in "0ee" or "0EE". My question is how do i change this code around so when i type in "0e" or "0E" it exits the program. Here is the code: // Program 6-4 Simple printing calculator NOTE: Program won't accept "e" or "E"...
0
9977
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9816
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10910
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10452
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9618
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8009
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6036
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4667
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3268
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.