Skip to content
Advertisement

Finding the first empty column in a data row

I saw similar questions and most turned into arguments about table design, normalization, etc. Not all of us have the luxury of making our clients change their database designs.

Here is my dilemma. My client asks that I make it possible for their workers to be able to add call out time for the preceding day. I will provide a pop-up to permit them to enter a callout_start and callout_stop for the day before. Many already have call outs for the previous day.

I want them to be able to update the next available callouts of the previous day. IOWs – the first callout that is null. The SQL has to be generic. I am writing to a dbIsam database that will be sync’d to an MS/SQL DB via remObjects.
Thanks

Advertisement

Answer

Well, you can use a complicated SQL statement to find the first null value. Then use conditional logic for updating all the columns:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement