473,396 Members | 1,915 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,396 software developers and data experts.

Dates: Just MM-YYYY?

I've got an app whose purpose in life is to do technical analysis of bond fund
returns.

Each return has a "Date", but the "Date" is really just a month/year.

i.e. The return for January of 2005 or the return for April of 1996.

Right now, to placate VBA and have use of the various date functions I'm storing
all the return dates with Day=01 - explicitly typed in by the user or assigned
by code that processes Copy/Pastes from Excel spreadsheets.

A few days ago, I stumbled onto the realization that if I typed "8/2005" into a
query's date prompt, whatever was between me and the query happily accepted it
as 08/01/2005. In fact, in the Immediate window I find:

?DateValue(#8/2005#)
08/01/2005

This got me thinking that I should shield the users from having to type that
"/01/" in every time they enter a return/date. Right now, I'm edit-checking
for the "01", but it seems to me like they should never even have to see the day
part of a return date.

I see the obvious like .InputMask and .Format, but don't know the full
implications of doing something like this - and I don't want to foul something
up that doesn't surface until months later...

Anybody actually been here?
--
PeteCresswell
Nov 13 '05 #1
1 1242
I avoid this mess by using a monthend date. So in your case it would
be 08/31/05. The formula to calculate these things is:
DateSerial(Year(Date()),Month(Date())+1,1)-1

I have never tried it your way, but I'll look into it.

Nov 13 '05 #2

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

Similar topics

5
by: PW | last post by:
<rant> Sorry guys, but I just have to whinge. Dates in ASP are a total pain in the butt! I seem to get caught out so many times. I realise its my own fault, but going from the posts in this...
19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
10
by: Robert Zirpolo | last post by:
For some reason a stored procedure which I have created is incorrectly saving the date to the table. It seems the day and month are being swapped around e.g. a date which should be the 12th April...
3
by: JP SIngh | last post by:
I have a SQL Database with an ASP front end. There are actually two webservers which connect to the SQL database in UK. i have two questions 1. How can I insert null values when inserting...
52
by: Andy Dingley | last post by:
I'm using this at present: <p title="Publication date" ></p> Works fine on screen, but Fangs/Jaws just reads it as "left bracket twenty-eight slash zero slash two thousand five fifteen colon...
11
by: Geoff Jones | last post by:
Hi I have a table that has a column with Date types. I am trying to view certain rows in the table using a DataView. Using the filter, I can view the rows with, for example, the date equal...
3
by: Amjad | last post by:
I want to subtract two Date variables and show the result in this format: hh:mm:ss I'm thinking that there might be an easy way of doing that. something like: .... Return...
5
by: JD | last post by:
Example Give me all the dates between 02/02/07 and 05/02/07 ? In Europe the answer must be 4 dates : 02/02/07 ; 03/02/07 ; 04/02/07 ; 05/02/07. JD.
1
by: Denis | last post by:
I have a date field in a database. I have been given forms to be printed out. The problem is that the form requires the date to be printed out in 3 seperate parts. In the form day month and year....
5
by: Mike1961 | last post by:
Period dates ( AAAA-MM-DD ) Hi all. I use this code ASP for insert period dates ( AAAA-MM-DD ) in a table Mysql, without Saturday and Sunday. by = "2008-05-02" to = "2008-05-12"
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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,...

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.