-----Original Message-----
Is there a control that I can put on a Form that would
let a userselect just the month value? I tried to find a way to
make theDateTimePicker or the Month Calendar do what I want but
I can't. Iwant a way for the user to say "Let me see what is in
the databasefor the month of January 2004." I don't want to have it
specified asJanuary 1 through January 31. I can do that in code
behind it. Icould use a combo, and just enter
January 2004
February 2004
March 2004
etc.
That would be perfectly satisfactory. For this
customer, there is noneed to go back to the past. But unless I put 10 years
worth ofmonths in the combo, there's a problem, as you can see.
Are there custom controls out there for sale? There
must besomething, but this is new to me and I don't know where
to look.
Thanks
----== Posted via Newsfeed.Com - Unlimited-Uncensored-
Secure Usenet News==----http://www.newsfeed.com The #1 Newsgroup Service in the
World! >100,000 Newsgroups---= 19 East/West-Coast Specialized Servers - Total
Privacy via Encryption =---.
hello there
what you need to do is first in the database : if you are
using a view then add a column to this view : if the date
field is for example xx_date then define the new column
in the view as DATENAME(month,date) which returns the
month name (january, february, etc); it is a function in
sqlserver (Transact_sql).
on your form creat a text box for the year to be entered
and a combo box containing the names of the 12 months
namely january, february, march, ...december).
adjust the select statement in your oleadapter to have ?
for the column created above. then upon entry of the year
and month you can use the year entered as the first
parameter and the month name as the second parameter !!
as follows:
myadapter.SelectCommand.Parameters(0).Value = year
(entered)
myadapter.SelectCommand.Parameters(1).Value = month *from
combo box)
you can do the same by using the month no. instead of
name if you want to but in this case the function
returning the month no. from the date will be MONTH
(xx_date) which returns 1 for jan, 2 for feb ..etc. and
you can have both values selected by entering in regular
text boxes.
if you need more help contact me be e-mail