Author Topic: Empty numeric field and value 0 saved identical  (Read 337 times)

Patrique

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Empty numeric field and value 0 saved identical
« on: November 09, 2020, 07:06:34 pm »
Hi Volker,

in our addresses we've got a creditLimit field for the customers. Customers can have no credit limit, a credit limit of 0 and a credit limit larger than 0. In the customer order we're trying to distinguish whether the customer has no credit limit (NULL) and the customer has a credit limit of 0. But both values seem to be saved as 0 in the database.

The database field is of type decimal(18,6) and set to "can be null=YES".

Before implementing a workaround using an additional check box with additional data field, I wanna make sure that there's no better way of doing this.

Thanks,
Patrique
« Last Edit: November 13, 2020, 11:18:08 am by Patrique »

volker.thebrath

  • Administrator
  • Newbie
  • *****
  • Posts: 46
    • View Profile
Re: Empty numeric field and value 0 saved identical
« Reply #1 on: November 09, 2020, 10:23:56 pm »
Hi Patrique,


at the moment, the only way to do this would be the checkbox solution, sorry.

Patrique

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Empty numeric field and value 0 saved identical
« Reply #2 on: November 13, 2020, 11:17:09 am »
Ok, thanks, we'll go the check box way :)