/ Published in: SQL
                    
                                        Declare a new_bi_number variable
Set the new variable
If the new variable is null, set it to 1000
Select it to show it
If the new variable is not null, Select it to show it
                Set the new variable
If the new variable is null, set it to 1000
Select it to show it
If the new variable is not null, Select it to show it
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
 DECLARE @new_bi_number VARCHAR(10) SELECT @new_bi_number = invoice_next_avail_number FROM bi_broker_invoice_number WHERE mx_company_id = 1 AND broker_invoice_type_id = 1 IF @new_bi_number IS NULL BEGIN SET @new_bi_number = 1000 SELECT @new_bi_number END ELSE SELECT @new_bi_number
Comments
                    Subscribe to comments
                
                