• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 124
  • Last Modified:

Easy question but need urgent help!

I am taking a class in ASP.NET.  I need to work with dates and text id fields.  I need to be able to enter a date in one text id box and a number in the other and then use the number to add days to the input date.  I cannot figure how to do this with dateadd or anything else!  Help in specific on this and I really need a good primer on using ASP.NET that does not expect you to have programmed for 10 years before you picked this application up.  Recommended reading PLEASE!
0
bergm57
Asked:
bergm57
1 Solution
 
appariCommented:
use dateadd function

eg:
DateAdd(DateInterval.Day, 2, Now)

I think MSDN is the best choice to learn.
0
 
aelatikCommented:
Convert to long ...

Dim a
a = CLng(CDate("12/10/1975"))
MsgBox a
0
 
supunrCommented:
On Error resume next
NewDate = dateadd("d", val(txtNoDays.Text), CDate(txtInputDate.text))
if (Err.Number <> 0) then
   msgbox "Invalid date!"
   txtInputDate.setfocus
   exit sub
end if

' this code is for VB.  VB.Net code should be similar.
' Good Luck!
0
 
bergm57Author Commented:
appari
Thanks!  That bit of code got me going again.  You are an ASP.NET guru!

The other code offered worked as well but not as efficient is all.  Thanks for your comments!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now