how to autogenerate date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rama Jayapal
    New Member
    • Mar 2007
    • 24

    how to autogenerate date

    i am using a gridviw to display values from database

    and using formview to insert values to gridview

    i have the following fields in formview during insert mode like

    Name :
    StartDate:
    EndDate:

    now when i enter the startdate
    the Enddate should automatically add 7 days to startdate and get inserted

    if its textbox i know we can add like

    DateTime.Now.Ad d(7);

    but for a field in formview is it possible to do that
    plz help me on this regard

    Rama
  • prabunewindia
    New Member
    • Mar 2007
    • 199

    #2
    hi friend,
    i didn't get u clearly.
    i think u have only the start date in table(database)
    u want display the end date also in the form view!
    so u get this in the query(sql) itself
    select name, startDate, startDate+7 as endDate from <table>

    i am not clear that with query (+7) not exactly correct.
    u search for exact query.

    in alternate method
    u code in html page in the field's text propert as Eval(date+7)
    i gave u only idea. not code
    try to convert this to code
    Prabu

    Comment

    • klaydze
      New Member
      • Mar 2007
      • 30

      #3
      Originally posted by Rama Jayapal
      i am using a gridviw to display values from database

      and using formview to insert values to gridview

      i have the following fields in formview during insert mode like

      Name :
      StartDate:
      EndDate:

      now when i enter the startdate
      the Enddate should automatically add 7 days to startdate and get inserted

      if its textbox i know we can add like

      DateTime.Now.Ad d(7);

      but for a field in formview is it possible to do that
      plz help me on this regard

      Rama
      hi, try this one. assuming that i put the value of the date in textbox
      txtdate.text=fo rmat(Now.AddDay s(7),"MM/dd/yyyy")

      Comment

      Working...