qb
qb copied to clipboard
default values - valueraw, min, max, sum
I would like to use max() to find a max taskID, but I need some kind of value to increment, even if there is no return. I would start with 0 in that case. The code below is a workaround, but the default value isn't working, with or without named arguments. I will coalesce for now, but I think this is a regression
base.taskID = qb .from( "holdings" ) .where( "jobID", base.jobID ) .valueRaw( "max(taskID)", 0, false, { datasource : "FTDIOpto" } ) + 1;