Microsoft Transact Query

mrtweaver

Member
Join Date
May 2007
Location
Bloomsburg
Posts
329
I was wondering, I have a similar posting on a SQL forum site, it has been there 2 days and it must not get the kind of traffic and attention this site gets. SO I am hoping someone on here would be willing to guide me in the right direction.

I am trying to create a Microsoft SQL query that will go thru a table and it will check the the status of the MECHPG column. Everywhere where the MECHPG column changes state the query will pull that row of data and only where it changes state.

The value of the MECHPG column is either a 1 (one) or a 0 (zero) Nothing else. The MECHPG column can have data as follows:

0
0
0
1 <---
1
1
1
1
0 <----
0
0
0
1 <----
1
0 <----
etc.....

If the above data was in a table and the query was ran the query would pull in the row of information at every place where you see an arrow. All other data would be ignored. Just the data where a change has occured.

So what is the easiest way to accomplish this using standard SQL transact statements?

Thanks to all.
 
Just so you also know this is not homework and I am not a student so to prove that I am also posting what code I have right now:


SELECT machine, start, stop, mech1, mech2, mechpg, t_stamp, shift from datalive where mechpg = 1

Thus far the query provides a table but it shows all places where mechpg = 1 not where it has changed. I have been trying the alter table and the trigger command but no success there. This is for a reports screen I am working on and the data will be in a view.

Thanks and have a great day.
 

Similar Topics

Hello everybody, I'm currently working on a project where I need to implement an IoT platform based on Microsoft Azure Cloud. Communication is...
Replies
3
Views
119
The problem we have is that a SERVER 2016 RDS HOST machine will not change the path to read the new SERVER2016 RDS LICENSE server. Instead, it...
Replies
4
Views
1,603
Does anybody use for remote tech support? Quick Assist, QA, comes with Windows 10 and 11 so it is "free" QA uses HTTPS for security but I wonder...
Replies
1
Views
1,400
I have been playing w/ my Microsoft 365 account. Found this as I was looking for Visio. Apparently there is this form app. I just started one...
Replies
2
Views
1,070
I'm wondering what people do these day when Excel is needed on an offline computer. Look at Microsoft Store's link, it seems it does require...
Replies
9
Views
2,599
Back
Top Bottom