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

What's wrong with this SQL for Date?

418 256MB
My form has two text boxes, txtDateFrom and txtDateTo. A macro button with the caption Month is to automatically fill in txtDateFrom and txtDateTo with current month date. My code reads as:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdmonth_Click() 
  2.  
  3. 'Sets the Date From and Date To text boxes 
  4. 'to show complete month (from start to end of current month) 
  5.  
  6.     Me!txtdatefrom = DateAdd("m", (today * -1), Date) 
  7.     Me!txtDateTo = DateAdd("d", -1, DateAdd("m", 1, Me!txtdatefrom)) 
  8.  
  9. End Sub 
what I want is this: 5/1/2009 -5/31/2009 but what I get is 5/15/2009 - 6/14/2009How can I modify this code to get This month instead of a month from today?

Thanks.
May 15 '09 #1
3 1272
Denburt
1,356 Expert 1GB
I posted in the other Thread.
http://bytes.com/topic/access/answer...te#post3488017

Is this a double post? If it is do you mind if I remove this one? If this isnt a duplicate please let me know so I can adjust the title as needed.
May 15 '09 #2
Seem to be a double post..... again I think format function might help ;)

Regards
Emil
May 15 '09 #3
Denburt
1,356 Expert 1GB
ok I am going to lock this one for now M if you don't feel this is a double post please P.M. me or another moderator with your reasoning if you would like this one unlocked.
May 15 '09 #4

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

Similar topics

3
by: K R | last post by:
Hi, I have generated this XML from my application. But, when I open this XML, it is throwing error. Please help me to resolve this. <?xml version="1.0" encoding="utf-8" ?> <searchResults>...
7
by: MLH | last post by:
Public Function GetLastDayOfMonth(ByVal dtDay As Date) As Date '************************************************************************** ' Accepts a date. Determines month & year of the date....
3
by: Soren Jorgensen | last post by:
Hi, Following code should give the number of weeks in years 1998-2010 for a Danish calendar (on a Danish box) GregorianCalendar cal = new GregorianCalendar(); for(int i = 1998; i < 2010; i++)...
3
by: Terry Olsen | last post by:
I've got 2 different web pages, both updating the same SQL database. One is for the Technician and one is for the Manager. The technician's update page works fine but the Manager's update page...
4
by: Hyphessobrycon | last post by:
Private Sub btnrubriekbij_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnrubriekbij.Click 'insert hier Dim cn As New OleDb.OleDbConnection(constr) Dim dc As...
7
by: arun_shamli | last post by:
class CDate { public: CDate() {} CDate(const CDate& date) {} }; CDate function1() { CDate date(); return date;
30
by: James Conrad StJohn Foreman | last post by:
After 3 years of using DB2 on Linux, I'm leaving my current employers to go work for a SQL Server shop instead. In order to find my replacement, they're trying to put together a set of questions...
2
by: Angus | last post by:
There are the C runtime library functions of course, but are there any STL time or date related functions? I couldn't find any.
34
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - What online resources are available? ----------------------------------------------------------------------- *...
11
by: MNNovice | last post by:
My form has two text boxes, txtDateFrom and txtDateTo. A macro button with the caption Month is to automatically fill in txtDateFrom and txtDateTo with current month date. My code reads 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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.