Hi!
First of all I'd like to thank whoever takes their time to respond, this issue has been bugging me for several hours now.
I should begin by saying that I'm not at all familiar with Microsoft Access, and only barely familiar with SQL. I've done some websites in the past, and managed to get the results I want by some heavy googling and testing, but this time it has me beat.
Basically I only want to take yesterday's registred starts and stops, and then subtract the latter from the first. I thought this would be a piece of cake, but no...
The code I have atm is;
SELECT COUNT (*)
FROM REGISTRY
WHERE (REGISTRY.[START])=Date()-1
-
(SELECT COUNT (*)
FROM REGISTRY
WHERE (REGISTRY.[STOP])=Date()-1);
which I thought would do just that. And it does, until it reaches 0... My problem here is that it doesn't give me a negative result (which I need, if the amount of stops for a given day is higher than the amount of starts). However, if I just do
SELECT 1-2;
I get -1, so obviously the limitation isn't in the Microsoft Access SELECT function.
So, long question short; How the hell do I get the above query to give me a negative result?
HUGE, HUGE thanks if anyone can help me!
First of all I'd like to thank whoever takes their time to respond, this issue has been bugging me for several hours now.
I should begin by saying that I'm not at all familiar with Microsoft Access, and only barely familiar with SQL. I've done some websites in the past, and managed to get the results I want by some heavy googling and testing, but this time it has me beat.
Basically I only want to take yesterday's registred starts and stops, and then subtract the latter from the first. I thought this would be a piece of cake, but no...
The code I have atm is;
SELECT COUNT (*)
FROM REGISTRY
WHERE (REGISTRY.[START])=Date()-1
-
(SELECT COUNT (*)
FROM REGISTRY
WHERE (REGISTRY.[STOP])=Date()-1);
which I thought would do just that. And it does, until it reaches 0... My problem here is that it doesn't give me a negative result (which I need, if the amount of stops for a given day is higher than the amount of starts). However, if I just do
SELECT 1-2;
I get -1, so obviously the limitation isn't in the Microsoft Access SELECT function.
So, long question short; How the hell do I get the above query to give me a negative result?
HUGE, HUGE thanks if anyone can help me!