Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have an application where I need to output the actual DATE of the month into a textbox.

 

so I have txt_sat.text = (DatePart("d", "txt_beginning))

 

where txt_sat is the text box

and txt_beginning stores the actually date (ie. 1/1/2003)

 

This gives me what I want. The date of the month..(ie. 27, 2, etc)

 

However I want to date of each day of the week in the same format. I can only get the first day and last day working.

 

for the dates in between I tried

 

txt_wed.text= DateAdd("d", 4, txt_beginning))

 

this does give the correct date but in the format of 12/1/2002

HOw do I make it so that it extracts only the date (in this case the '1'???

 

I think it should be the datepart function but if i use that i get this following error

 

Additional Information: Argument 'datevalue' cannot be converted to type 'date'

 

 

Thanks in Advance :confused:

  • Leaders
Posted
How did you use the DatePart function and why aren't you using the .NET System.DateTimes?

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted

Hey guys: Thanks for your suggestions

 

i think that its not using datetime, but rather date

I thought of using a Ctype convert b4 but it seems what i need is the actual date and not full date(at full date its working the way i want it to ;) ]

 

 

IcePlug: DatePart function was as follows:

 

  txt_sat.Text = (DatePart("d", txt_beginning)) 

  • Leaders
Posted

What's the difference between an actual date and a full date? :confused:

You can always provide a format string for .ToString()

:)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

  • 2 weeks later...
Posted

Thanks for your suggestions guys...

 

Just for anyone who may need this: I solved this using this

 

Dim adate As Date
       adate = strTemp
       adate = adate.AddDays(1)
       txt_sun.Text = (DatePart("d", adate))
       adate = strTemp
       adate = adate.AddDays(2)
       txt_mon.Text = (DatePart("d", adate))

 

 

Its probably not the BEST way but it works for me..:)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...