Tag: SAP Business One Tips

Using variables in SQL queries for SAP Business One is straight forward for simple select statements but what about the more complex variables or if you want to declare a variable for your SQL? Answer: You have to get a bit more creative! See the example below. To select a from and to date as a variable in a declare statement you have to add a nifty bit of extra code. /* /SELECT FROM [dbo].[VPM1] T0/ declare  @fromdate as datetime /* WHERE */ set @fromdate = /* T0.DueDate */ ‘[%0]’   /SELECT FROM [dbo].[VPM1] T1/ declare  @tilldate as datetime /* WHERE */ set @tilldate = /* T0.DueDate */ ‘[%1]’     select  OVPM.docnum, VPM1.dueDate,VPM1.CheckNum, VPM1.Branch, VPM1.BankCode, VPM1.CheckSum, OVPM.CardName,…

SAP Business One – Date Deviates From Permissible Range The ever popular Date Deviates From Permissible Range error message appears for two reasons and IS easily solved! The usual occurrence is in the New Year when new posting periods need to be created. To resolve this simply create a new posting year/period in (and watch out for your sub-periods!): Within SAP Business One in the Main Menu or top menu Modules option go to – Administration –> System Initialisation –> Posting Periods The second occurrence is when you are trying to post documents with a due date that is not covered by the created Posting Periods Due Date range. This usually occurs towards the end of the year. You can solve this…