Source language: Translate to:

Delete a date

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Delete a date

Postby fieldhopper » Wed Mar 13, 2013 2:19 am

Hi !

I have a date-field in a mysql-db. On start the field contains NULL. The user fills the field with a date. When i now try to delete this field with blank or zero, the old content will reset to the input of the user. How can i delete this field with neobook.
Regards fieldhopper

____________________________________________________
Es sind schon viele erfroren, aber noch keiner ist ermieft.
____________________________________________________
User avatar
fieldhopper
 
Posts: 121
Joined: Sun Mar 09, 2008 11:39 am
Location: Germany

Re: Delete a date

Postby Neosoft Support » Wed Mar 13, 2013 9:34 am

You can try setting the date to an empty string, but if the database won't accept it then you will have to substitute a different date.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Delete a date

Postby fieldhopper » Thu Mar 12, 2015 4:27 am

Ok, i have found, after a long time, the special idea to delete the date.
Code: Select all
If "[LEP.teilzeit.Tgiltbis]" "=" "  .  .    "
SetVar "[z_id]" "[LEP.teilzeit.id]"
dbpExecSQL "LEP" "update teilzeit set tgiltbis = NULL where id=[z_id]" ""
endif

That is the result and it funzt :).
Regards fieldhopper

____________________________________________________
Es sind schon viele erfroren, aber noch keiner ist ermieft.
____________________________________________________
User avatar
fieldhopper
 
Posts: 121
Joined: Sun Mar 09, 2008 11:39 am
Location: Germany

Re: Delete a date

Postby stu » Thu Mar 12, 2015 7:08 am

fieldhopper wrote:Ok, i have found, after a long time, the special idea to delete the date.
Code: Select all
If "[LEP.teilzeit.Tgiltbis]" "=" "  .  .    "
SetVar "[z_id]" "[LEP.teilzeit.id]"
dbpExecSQL "LEP" "update teilzeit set tgiltbis = NULL where id=[z_id]" ""
endif

That is the result and it funzt :).


Quick question!

Why would you have something like " . . " stored on a db? is some sort of default?
Microsoft Access hater.
User avatar
stu
 
Posts: 318
Joined: Wed Aug 07, 2013 11:37 am

Re: Delete a date

Postby fieldhopper » Thu Mar 12, 2015 8:42 am

It comes from the Inputfield. Use a mask for formatted input. The db-field is stored normally.
Regards fieldhopper

____________________________________________________
Es sind schon viele erfroren, aber noch keiner ist ermieft.
____________________________________________________
User avatar
fieldhopper
 
Posts: 121
Joined: Sun Mar 09, 2008 11:39 am
Location: Germany

Re: Delete a date

Postby Neosoft Support » Thu Mar 12, 2015 10:21 am

Thanks for sharing your discovery with us!
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Delete a date

Postby stu » Thu Mar 12, 2015 11:12 am

fieldhopper wrote:It comes from the Inputfield. Use a mask for formatted input. The db-field is stored normally.


What about not allowing the user to input and instead using dbpPopupDateSelector (?) then you no longer expose your data to inconsistency.
Microsoft Access hater.
User avatar
stu
 
Posts: 318
Joined: Wed Aug 07, 2013 11:37 am

Re: Delete a date

Postby fieldhopper » Thu Mar 12, 2015 11:19 pm

Thanks for this nice note dbpPopupDateSelector. But how to delete the date (set to NULL)?.
Regards fieldhopper

____________________________________________________
Es sind schon viele erfroren, aber noch keiner ist ermieft.
____________________________________________________
User avatar
fieldhopper
 
Posts: 121
Joined: Sun Mar 09, 2008 11:39 am
Location: Germany

Re: Delete a date

Postby stu » Fri Mar 13, 2015 11:04 am

fieldhopper wrote:Thanks for this nice note dbpPopupDateSelector. But how to delete the date (set to NULL)?.


Sorry I got a bit lost on this last post. Can you explain a bit of the process your trying to accomplish so I can get an insight? =)
Microsoft Access hater.
User avatar
stu
 
Posts: 318
Joined: Wed Aug 07, 2013 11:37 am

Re: Delete a date

Postby fieldhopper » Sun Mar 15, 2015 8:44 am

fieldhopper wrote:Ok, i have found, after a long time, the special idea to delete the date.
Code: Select all
If "[LEP.teilzeit.Tgiltbis]" "=" "  .  .    "
SetVar "[z_id]" "[LEP.teilzeit.id]"
dbpExecSQL "LEP" "update teilzeit set tgiltbis = NULL where id=[z_id]" ""
endif

That is the result and it funzt :).


So was my start for this topic.
Regards fieldhopper

____________________________________________________
Es sind schon viele erfroren, aber noch keiner ist ermieft.
____________________________________________________
User avatar
fieldhopper
 
Posts: 121
Joined: Sun Mar 09, 2008 11:39 am
Location: Germany


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests