Hello,
I've got possibly a simple question, but I've gone from not knowing any SQL to trying to go 'advanced' in about a week.
I have a table with Jobno, Prefix and PackID along with weight.
So each parcel contains a weight, these are added to the table via being scanned. There are no checks when entering into the table, and there can't be.
The problem I have is I need get a sum of all the weights.
I did use
"SELECT SUM(Weight) as 'Total Weight' FROM `Labelfiles` WHERE `date_stamp` = <TODAYSDATE>"
and this works fine, however, I've now been asked to ignore the duplicate scans.
I could probably do this using PHP variables, but would be demanding on a 166Mhz Unix machine when there are 100000+ entries.
I was wondering how I could alter my code to take this into account.
The problem is the PackID may not be unique, nor the prefix and jobno, but all three together will be (unless a duplicate scan has been made)
Any ideas?
I've got possibly a simple question, but I've gone from not knowing any SQL to trying to go 'advanced' in about a week.
I have a table with Jobno, Prefix and PackID along with weight.
So each parcel contains a weight, these are added to the table via being scanned. There are no checks when entering into the table, and there can't be.
The problem I have is I need get a sum of all the weights.
I did use
"SELECT SUM(Weight) as 'Total Weight' FROM `Labelfiles` WHERE `date_stamp` = <TODAYSDATE>"
and this works fine, however, I've now been asked to ignore the duplicate scans.
I could probably do this using PHP variables, but would be demanding on a 166Mhz Unix machine when there are 100000+ entries.
I was wondering how I could alter my code to take this into account.
The problem is the PackID may not be unique, nor the prefix and jobno, but all three together will be (unless a duplicate scan has been made)
Any ideas?