Editing SQL

14 01 2009

Having completed the Summary Form for Diagnostic Cases, I am now creating the PCI Summary.

A lot of the data is shared, so I thought a “Copy & Paste” approach would work.

Editing the Diagnostic Queries is somewhat difficult in the standard Design View of OpenOffice, so I decided to do it manually with the SQL View.

Knowing nothing at all about SQL, this was a learning experience…

Essentially, given that the majority of the Aliases and Queries are named identically, just with a “p” substituting for the “d” of Diagnostic, I was able to just edit each “d” and replace it with a “p”.  Additionally, the Queries which specify “Diagnostic=1” had to be replaced with “PCI=1” and those specifying “Operator=1st” had to be replaced with “PCIoperator=1st”; the corresponding table column name was also changed.

For example (Query d1st):

SELECT “Operator” AS “d1st”, “Diagnostic” FROM “AngioTable” AS “AngioTable” WHERE “Operator” = ‘1st’ AND “Diagnostic” = 1

became (Query p1st):

SELECT “PCIoperator” AS “p1st”, “PCI” FROM “AngioTable” AS “AngioTable” WHERE “PCIoperator” = ‘1st’ AND “PCI” = 1

and (Query d1stCount):

SELECT COUNT( “d1st” ) AS “d1stN” FROM “d1st” AS “d1st”

became (Query p1stCount):

SELECT COUNT( “p1st” ) AS “p1stN” FROM “p1st” AS “p1st”

Advertisements

Actions

Information

2 responses

13 02 2009
L H

Your logbook looks great. I dislike using microsoft and prefer to keep things open source. I have been advised to use BCS logbook to present at RITA/ARCP, but did not want to use it on a windows machine. I was just about to start building my own DB when I found yours. I would be very grateful for a copy of your DB. Is there a password to download from drop.io?? Thanks.

14 02 2009
ugm6hr

The password is given on the Downloads page, along with my license details (Creative Commons).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: