473,398 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Convert date to number and back

I have a need to convert simple dates (i.e. 02/14/2005) to a number,
do some math, and convert back to a date. (in a simple query).
The math involves adding or substracting days, and days of the week .
I've used the weekday() function to convert dates to numberic days of
the week (1-7)

I've used cdbl (date) to convert a date to a serial number, but then I
do math with the number and I can't seem to convert this back to a
date.

Help is appreciated

Thanks
Jerry Ranch

Nov 13 '05 #1
3 28999
Jerry,
You are making this harder than it needs to be. DateAdd & DateDiff are two
functions for adding & subtracting dates that Microsoft includes with VBA.
Try those.

--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS"

<je*********@pioneer.com> wrote in message
news:ia********************************@4ax.com...
I have a need to convert simple dates (i.e. 02/14/2005) to a number,
do some math, and convert back to a date. (in a simple query).
The math involves adding or substracting days, and days of the week .
I've used the weekday() function to convert dates to numberic days of
the week (1-7)

I've used cdbl (date) to convert a date to a serial number, but then I
do math with the number and I can't seem to convert this back to a
date.

Help is appreciated

Thanks
Jerry Ranch

Nov 13 '05 #2
Jerry,

Look at the DateAdd and DateSerial functions in the Help file. They will
probably do all you want to do without any conversion.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
<je*********@pioneer.com> wrote in message
news:ia********************************@4ax.com...
I have a need to convert simple dates (i.e. 02/14/2005) to a number,
do some math, and convert back to a date. (in a simple query).
The math involves adding or substracting days, and days of the week .
I've used the weekday() function to convert dates to numberic days of
the week (1-7)

I've used cdbl (date) to convert a date to a serial number, but then I
do math with the number and I can't seem to convert this back to a
date.

Help is appreciated

Thanks
Jerry Ranch

Nov 13 '05 #3
Thanks people
I got the tools I need now
Jerry

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: sumeet | last post by:
how do i convert a yyyymmdd format to yyyy,mm,dd format. also i want to know how do i get the number of days between two dates which r in the format yyyymmdd. how to convert date into unix time...
3
by: galsaba | last post by:
What would be the function to convert date to the number of date for example, 2/14/05 is 45, becuse this is the 45th day of the year. What would be the function? Where can I find info on the web...
7
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
3
by: sparkle | last post by:
Hi, Does anybody know how to convert date to ticks from a dateTimePicker? What I'm using now isn't working. I'm trying to use a dateTimePicker to set an appointment in Outlook with a...
1
by: prabhunew2005 | last post by:
I am using postgres,php in web designing. I have to convert date entered in MM-DD-YYYY format to YYYY-MM-DD format. I have to use resulting date format in my search sql. I used todate method. But i...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ 3.5. - How do I convert a Number into a String with exactly 2 decimal places?...
19
by: VK | last post by:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/ b495b4898808fde0> is more than one month old - this may pose problem for posting over some news servers. This is why I'm...
15
by: Lyosha | last post by:
Converting binary to base 10 is easy: 255 Converting base 10 number to hex or octal is easy: '0144' '0x64' Is there an *easy* way to convert a number to binary?
2
by: favor08 | last post by:
7/19/2007 12:46:30 am. is in a field called CmplteDte. It is a date stamp of when the user completed the item. I need the time for a report but for a form that the supervisors use to QA the previous...
4
subedimite
by: subedimite | last post by:
Here I am with another question being a very new VBA user. I have this scenario to work with: I would think this is fairly common routine of work for VBA. I have a string of hex contents as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.