473,513 Members | 2,513 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 1427
creative1
274 Contributor
Try this
IF you enter date in masked text box. It could be anywhere
d = StartingDate_msk.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_msk.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
2414
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...
2
3637
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...
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...
2
5005
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...
0
1170
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? ...
2
9597
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...
25
2551
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...
5
2821
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,...
10
14615
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...
0
7161
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
7384
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
7539
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...
1
7101
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
7525
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
4746
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...
0
3234
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...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.