No announcement yet.

date and time problem

  • Filter
  • Time
  • Show
Clear All
new posts

  • date and time problem

    Hey guys, am having a minor issue with two fields within a form.

    The form works fine on insert, which I copied to create a new form to update, ie two separate forms (created from the initial (working)).
    On update I get two errors:

    Start Date: Invalid data
    - the date is as DATE format within the DB and form, funny that on insert it works fine, but on update even with the date already available from db I get the above error.
    Little stumped on this one as I dont find any issues with the forms. I even created a new form to test for insert and update, which works fine..... so why am I getting this error when the form is locked to update only???

    The second field is only available on update which is a TIME field, i.e. hours, minutes and seconds.
    On form open the field displays the time format: HH:II:SS and of course tells me incorrect format on update/save of form. (yet the time may not be ready to be inserted yet.....)
    I tried adding the below into the OnScriptInit and OnBeforeUpdate, but as the field already has the HH:II:SS it doesnt apply the 0's to solve that.....

    {timecalc} = '00:00:00';

    Any ideas for those annoying little issues? Please Share!

  • #2
    I have managed to fix the time field issues I was having, had to set 000000 as default in database, had 00:00:00 set which was causing the time field to always display as MM:II:SS.

    The date field is still giving me an invalid field error on the edit/update of a field, even if I dont change the date when actually edited.
    On insert it is working perfectly and inserts the date, then edit I get the error......

    Kinda frustrating as I have checked everything a few times now. the db field is set as "date" and "NULL", insert provides: 2015-01-06 and in the form the field is using the regional values and displayed as "dd/mm/yyyy". When I update a selection the date inserts into the field as "Y-m-d" which displays and inserts fine. On edit a specific selection does the same thing again for a second date field basically "startdate" and "finishdate". Both fields present the same "invalid data" error when updating even when not changing the actual saved data from insert.

    Erm help whys is this happening? any ideas ?


    • #3
      Guys I have to let you know how cheesey peed I am about not having a reply on something so dam simple.

      I am still having this issue with an edit form, I have recreated and redone to many times I am tearing my blimmin hair out. I have change the date from Regional Settings on and off and modified the settings also for the date i.e. regional off, seperator: / dd/mm/yyyy for the view.
      This again inserts fine, but will not edit with the same settings (or regional ON).

      In the DB I have the usual setup so date field with 0000-00-00, on form view it is displayed as dd/mm/yyyy or 00/00/0000. (startdate date Yes NULL & enddate date Yes NULL).
      I would usually use the default regional settings as it has never presented this issue, but now for some ridicules reason it is.

      The same form is used for the insert and edit, copied/replicated form that is. so identical other than one if for insert and the other for update (with some extra fields available).

      On insert it is working and adding the date correctly, on edit it is not and kills the old date with 0000-00-00

      HELP HELP HELP HELP this is now starting to stop everything I am doing.


      • #4
        has you some export of the app?. I'm a little tired today, and I'm not visualizing in my mind what's the problem sorry.

        Professional Scriptcase Services
        Some Customers opinions


        • #5
          hey Giu, no worries. erm I can export it for u and upload to my server for u to download if u like.... I guess u would want the db also right.... of course lol Let me do that in the next hours and will post back here later today. Am ok for another day or tow to have this solved still working on other things but this is of course quite an issue.

          Anyhow I will try and explain a little more calmly

          I create an insert form with two date fields, i.e. start and end date. I copied the form as Edit, so now two identical forms with date fields.
          On the insert only form it adds the dates fine, no problem.
          The edit form keeps telling incorrect format.....

          Its the same form same settings same dd, so how does that make sence lol not much here.

          Will try and get that up in the next hours, possibly take some more hours to upload, check back tomorrow bud and will mail u the file location


          • #6
            Hey Gui, I have mailed u the details.... thx in advance for your help man!