473,545 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

accessing year and month part frm the entered date

66 New Member
hi......
Its very urgent......... ..... how can i take only the year and month part and it should save in the database in the month and year field separately..... .... when i enter the date in the form it should automatically update the year and month field in the db........ in my proj i am drawing a graph on daily, monthly and yearly basis..... i got how to draw a graph on day basis but i dont know how to draw a graph on month and year basis can any one help me plz.......... i am using vb6.0 and back end ms access........
Oct 13 '07 #1
2 1428
creative1
274 Contributor
Try this
IF you enter date in masked text box. It could be anywhere
d = StartingDate_ms k.Text
Dim m As String
Dim d As String
Dim y As String
m = (d)
d = Mid(d1, 1, 2)
y = Mid(d1, 4, 2)

it will extract day, month and year in variables. You can use them for validation checks or other processing

take care
Farhana
Oct 13 '07 #2
rekhasc
66 New Member
Try this
IF you enter date in masked text box. It could be anywhere
d = StartingDate_ms k.Text
Dim m As String
Dim d As String
Dim y As String
m = (d)
d = Mid(d1, 1, 2)
y = Mid(d1, 4, 2)

it will extract day, month and year in variables. You can use them for validation checks or other processing

take care
Farhana



i am using adodc1......... and when i enter the date in textbox it is storing in the database but i want to simultaneously store only month and year part in the database in different fields......... .............
in database the date format is medium date (1-jun-2007)

plz give me the code to do ths
Oct 13 '07 #3

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

Similar topics

2
2420
by: Douglas | last post by:
I have a Vehicle MOT field in my table which i have as a Date field I dont really want to hold the year, just 'dd mmm' as MOTs are the same date every year. I have the field on my form as a listbox holding all the dates of the year, except 29 Feb which i dont need anyway. When i select a value from the list i.e. 14 May and it stores it in...
2
3640
by: Mary | last post by:
I am trying to develop a query which will determine the average costs using a rolling average of the past 12 months of data. In other words, if I entered the Ship Month of January and the Ship Year of 2004, I would want that month plus the preceding 11 months of data to determine an average cost. How can that criteria be entered in a query...
2
485
by: Burghew | last post by:
Thanks for the previous replies..... What I need is to generate invoices for customers whom we rent out equipment. I will be choosing the date and year say for December 2005 print the invoices for customer A or B or .../ for all the equipments they have with them. This Dec 2005 must be selected by the user through a combo box. I have no...
2
5010
by: owz | last post by:
Ok, I am making a program (java class file) 2 work out if a date entered is valid or invalid for the day, month year, and for leap years.. dd/mm/yyyy . I seem 2 have gotten it 2 validate the year and month, but my code errors on the day validation. Error(91,38): variable daysInMonth might not have been initialized. Any thoughts, all help...
0
1171
by: ClassicNancy | last post by:
If I want to remove the drop down for the year will that make the birthday not show on the calendar? If it looks like it is ok to remove it what can be removed?? What should it look like? function date_selection($default_date="", $field_names=array("user_birthday_month", "user_birthday_day", "user_birthday_year"), $labels=1) // Returns date...
2
9614
by: =?Utf-8?B?Sm9lIFRhdmFyZXM=?= | last post by:
I am using the DateTime.Parse method to parse user entered dates. The dates can be just the year, Month-year and Month-day-year in a variety of formats in a variety of cultures. I immediately parse out the year case since I can determine that very easily (ie it is 4 digits) and store a boolean to let me know it is just a year. The problem I...
25
2552
by: rekhasc | last post by:
hi...... Its very urgent.............. how can i take only the year and month part and it should save in the database in the month and year field separately......... when i enter the date in the form it should automatically update the year and month field in the db........ in my proj i am drawing a graph on daily, monthly and yearly basis..... i...
5
2825
by: cssExp | last post by:
the problem is, i have a dynamic database driven site, each data is entered with year, week etc.. 2 months ago assuming I'll create sort option in future i put everything, i.e year, week, hour, minute etc.. but forgot month. Now i'm adding sort option but i need month but not available during database entry i use the following. $year =...
10
14622
by: sparks | last post by:
We are entering mm/dd/yyyy but some of the date fields only contain years. Can a date be made to only take a year entry if that is all that they have? can it be made to take only 2008 or maybe even 00/00/2008
0
7467
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...
0
7656
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7419
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...
1
5326
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...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3442
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
703
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...

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.