Skip to content

Tag: sql

SQL replace and calculate character length and replace again

I want to do an update on a Firebird table. So far not a problem: Before the update statement my params look like this: After my update the params look like this: So far it’s ok. But the frontend program can not handle this because there is a checksum in the params. The value s:91 is the character lengt…

Split Row and Paste to Different Tables Based on Column

I have a table like this. Table is populated each time an order is complete. One order can have one or many compartments. Please help write an SQL script that takes the above and splits it into two new tables like so: Table 1 Table 2 I’ve tried using the DISTINCT command as suggested; Which returns the …

Join two columns as a date in sql

I am currently working with a report through Microsoft Query and I ran into this problem where I need to calculate the total amount of money for the past year. The table looks like this: How would you calculate the total amount from 02-2019 to 02-2020 for the item number 12345? Answer Assuming that you are ru…