wootscootinboogie

1

votes
1

answer
569

views

Test if field from one table matches field from another Access 2007

SELECT Visits.KHA_ID, tblKentuckyCounties.countyName, tblHospitals.HospitalName, hospitalCounties.countyName FROM (HospitalType INNER JOIN (hospitalCounties INNER JOIN tblHospitals ON hospitalCounties.countyID = tblHospitals.countyFK) ON HospitalType.HospitalTypeID = tblHospitals.HospitalTypeFK)...
wootscootinboogie
1

votes
2

answer
664

views

Design : multiple visits per patient

Above is my schema. What you can't see in tblPatientVisits is the foreign key from tblPatient, which is patientid. tblPatient contains a distinct copies of each patient in the dataset as well as their gender. tblPatientVists contains their demographic information, where they lived at time of admis...
1

votes
2

answer
619

views

Ad hoc 2x2 contingency tables SQL Server 2008

I'm looking at ways of creating contingency tables in SQL Server 2008. They don't necessarily have to appear in the 2x2 typical matrix. I'd just like to know if anyone out there can see a better solution than mine. Please refer to the picture for clarity. The red letters are names of the squares...
wootscootinboogie
1

votes
2

answer
1.7k

views

Removing quotes added to column names from Excel import SQL Server 2008

I've noticed that when I use SSMS to import an Excel spreadsheet into SQL Server quotation marks are added. I've read somewhere that for whatever reason it's necessary for Excel to do this. Once in SQL Server, these quotes around the column names are useless and I'd like to have a programmatic way...
wootscootinboogie
1

votes
1

answer
151

views

Casting as float vs int returning different results

Mathematically, these results are similar, I'm just curious about their behavior. The first version when my local variable is declared as a float, the rounding function stops the decimals displayed at the second decimal. In the second version with the local variable declared as an int the round fun...
wootscootinboogie
1

votes
1

answer
327

views

NewID() not returning a random a sample [duplicate]

Possible Duplicate: Random sampling from a large dataset I posted a question earlier here And I thought that everything was fine and dandy, but when I went to check out the randomness of the result, I found that there was none. The other aspects of the query work fine, but I'm getting the top X nu...
wootscootinboogie
1

votes
1

answer
37

views

Change nullability add primary key in one statement

Is there are more terse way of writing (SQL server 2008) alter table newclaims alter column id int not null go alter table newclaims add primary key(id) the table is very large and this will have to make two passes over it and I'd like to know if I can change the nullability and add the primary key...
wootscootinboogie
1

votes
2

answer
53

views

Properly delegating requests to an inner object

I'm trying to find out whether or not I'm looking at containment/delegation the correct way. In this example I've got a Car and a Radio type. I have a function that takes in a string and changes the value of the IsOn property of the Radio object. I would like to know which approach (or neither) i...
1

votes
1

answer
212

views

Refactoring techniques for data access layer

I've got a data access layer to which I am binding some controls. Currently I have something along the lines of public List GetRaces() { List raceList = new List(); using (var con = new SqlConnection(this.ConnectionString)) { using (var cmd = new SqlCommand('spGetRace',con)) { cmd.CommandType = Comm...
wootscootinboogie
1

votes
2

answer
73

views

Removing dynamically created page elements

Check out the behavior in the fiddle here. $(document).ready(function () { $('.tile').draggable(); $('.tile').on('dragstart', function () { var numClones = $('.tile').length - 1 if (numClones > 0) { //why can't I use fadeOut or empty here? //make sure we don't remove the clone before it's made $('.t...
wootscootinboogie
1

votes
1

answer
247

views

jQuery each returning only last element, Google charts API

I've the following code which will take an array and append to the page dynamically a QR code with the text being an element in the array. $(document).ready(function () { var list = ['dog', 'cat', 'mouse', 'hippo', 'ox']; var qrUrl = 'https://chart.googleapis.com/chart?'; //functions function getQrC...
wootscootinboogie
1

votes
1

answer
1.9k

views

Zen Coding with ASP.NET MVC

Is it possible to write your HTML with Zen Coding expressions into your CSHTML? Say, something like `foreeach(var str in list) { table>(tr>td[str]) } where you can use C# variables in your HTML coding while writing Zen code stuff?
wootscootinboogie
1

votes
1

answer
241

views

ASP.NET MVC 4 Paging parameter out of bounds

I've got a simple ProductController with one method, List that talks to a repository and does some simple paging. The List method takes one parameter, an int to get the page currently being displayed by the view. I'm trying to redirect the user to /Product/List/1 if the parameter is more than the...
wootscootinboogie
1

votes
1

answer
45

views

Ternary execution of functions

I'm working on a project that will do a lot of processing of numbers in arrays. To try and encapsulate some condition logic I've done something like //ignore the fact that it's a bad idea to extend JS base types Array.prototype.ifThenElse = function (statement, funcA, funcB, args) { return (stateme...
wootscootinboogie
1

votes
1

answer
10.2k

views

jQuery DataTables Ajax Data Source

I find the documentation for DataTables when using AJAX as the data source limited. I've got a method in my controller in an ASP.NET MVC 4 application that returns a simple JSON result, and I'm trying to fill a DataTable with the following: $.ajax({ type: 'GET', dataType: 'json', contentType: 'appl...
wootscootinboogie
1

votes
1

answer
19

views

Sharing constructor parameters with closure

I'm trying to understand why one of these versions works and the other does not. Why is it illegal to make the getConfigFails assignment? var MyClass = (function(){ var _config; function MyClass(config){ _config = config; } MyClass.prototype.getConfigWorks = function(){ _config.getConfigWorks(); }...
wootscootinboogie
1

votes
1

answer
128

views

d3 radial wipe animation clips one element

The intent of this code is to click on a pie slice and have all of slices animated in a shrinking and expanding fashion. When I run the following code for a single element, they all work. When I try to animate all arcs at the same time, the smallest one disappears. Fiddle http://jsfiddle.net/fk03x...
1

votes
1

answer
314

views

Angular 2-4 observable that comes from a click event

I have a function that returns an Observable when a row in a table is clicked. private onEnrollmentHistory(val: Enrollment[]) { this.enrollments = val; console.log(this.enrollments); } getEnrollmentHistoryById(id: number) { this.toggleMoreInfoDialog(); return this.store.getEnrollmentHistoryById(id)...
1

votes
1

answer
0

views

Person ID # with two records from a many-to-many relationship Access 2007

Above is a screen cap of my schema. The visits table has a list of personal ID numbers and ICD is a list of codes that pertain to a certain person. You can see from the junction table that there's a many-to-many relationship between Visits and ICDTable. I'm trying to make a query that allows a per...
wootscootinboogie
1

votes
1

answer
36.7k

views

Make excel only display two decimal places

I've tried various things and nothing is working out quite like it should. I've used the office button, excel options, advanced, and set the automatic insert decimal place to 0'. Then I tried the format cells, and set the decimal places to 2 method. Nothing gives me what I want. I either end up w...
1

votes
4

answer
171

views

Subquery with multiple joins involved

Still trying to get used to writing queries and I've ran into a problem. Select count(region) where (regionTable.A=1) in ( select jxn.id, count(jxn.id) as counts, regionTable.A from jxn inner join V on jxn.id = V.id inner join regionTable on v.regionID = regionTable.regionID group by jxn.id, regionT...
1

votes
1

answer
618

views

Insert random data from one column to a column in another table

I'm wanting to insert random data from one field into another. I'm unsure of the syntax for this completely, So I'm thinking icdtbl.icd_id = primary key icdjxn.icd_id = foreign key insert into icdjxn (icd_id,patiendID) select top 5000 icd_id from icdtbl order by newid(),select top 5000 patientID fr...
1

votes
1

answer
55

views

Change one field from a key in two related tables

I have two tables related by a composite primary key and one of the fields in the key needs to be changed. Can this be done without deleting the relationship and then re-establishing it after the value is changed? myTable myTableID CPK firstField CPK this needs to be changed secondField CPK myO...
1

votes
2

answer
127

views

grouping and aggregates with subqueries

I have a query that is designed to find the number of people who went to a hospital more than once. What I have works, but is there a way to do it without the subquery? SELECT count(*) as counts, hospitals.hospitalname FROM Patient INNER JOIN hospitals ON Patient.hospitalnpi = hospitals.npi WHERE...
wootscootinboogie
1

votes
1

answer
2.2k

views

Using a CTE in a Delete Statement SQL Server 2008 r2

I have a CTE which pares down a set of people based on their ID numbers. I don't have a good way to test this at the moment. I haven't used a CTE in conjunction with a delete statement before, I think this is right but I'd like to proceed after I'm sure. I did test this and I got the following err...
wootscootinboogie
1

votes
2

answer
56

views

Joining on a non-PK field, does length of varchar datatype determine query speed? SQL Server 2008

I was given a ragtag assortment of data to analyze and am running into a predicament. I've got a ~2 million row table with a non-unique identifier of datatype varchar(50). This identifier is unique to a personID. Until I figure out exactly how I need to normalize this junk I've got another questi...
wootscootinboogie
1

votes
1

answer
95

views

Production uses of Table Value Parameters

I've just begun to learn how to write stored procedures and SQL code outside of the basic DML stuff. Something that I've recently come across is table value parameters. I've found a script to make a TVP and it works just fine but there are two things that I don't understand about it. One, when to...
wootscootinboogie
1

votes
2

answer
297

views

Why is a static html page loading instead of Wordpress?

I have WordPress installed in my main directory for my website and not in /wordpress. Currently my htaccess file has in it DirectoryIndex index2.html. This points to a static html page that was my landing page before installing wordpress. Now, when I visit my site after having installed WordPress...
1

votes
1

answer
149

views

Firing order of cached events

Say I have a simple form with only two text boxes and a button. The text boxes have AutoPostBack set to false. Say put some code inside of the TextChanged event of those to write to the response stream saying which TextChanged event was fired after a button is clicked and the form is submitted to...
1

votes
2

answer
152

views

Default value for DropDownList removing controls from a div

I've got a DropDownList which is databound to a table that has a simple descriptive text column and a column for ImageUrls. When the user clicks chooses from the DropDownList an image is added to a div. I have the AutoPostBack property of the DropDownList set to true so the user can have a better...
1

votes
3

answer
409

views

Dynamic div loaded only after second click

I've got an element in the DOM that's draggable and when it's clicked, I want to grab the x/y coordinates (not shown in this example, but for the future) and the height of tooltip that fades in. The source text for the tooltip is an AJAX call and can be of variable length. My problem currently is...
wootscootinboogie
1

votes
2

answer
35

views

Passing arguments to anonymous function of module

$(document).ready(function () { var patient = (function (options) { var age = options.age; var name = options.name; function getName() { return this.name; } function setName(val) { name = val; } function getAge() { return this.age; } function setAge(val) { age = val; } return { getAge: getAge, setAg...
wootscootinboogie
1

votes
1

answer
46

views

OO JavaScript circumventing .call

Take a look at the fiddle here In the show function the JavaScript call method is used to make this refer to the container variable in my contactForm object. I think, I'm not too sure about the magic that makes this work. Can someone elucidate why this does work, and what a good alternative might...
wootscootinboogie
1

votes
1

answer
52

views

Version files locally with Tortoise SVN

I'm new to use CI and source control in general. I'm working on a project where I've checked out a working copy of the repository onto my hard drive. I find that as I'm working with a particular file, I'll periodically break/fix things. I'd like to get something working, commit that change so I k...
1

votes
1

answer
41

views

Execution of dynamically loaded JavaScript

Let's say depending on some condition your application dynamically fetches some script. Is that action synchronous and blocking, e.g. any ongoing rendering of HTML stops, or is it done asynchrounously?
wootscootinboogie
1

votes
3

answer
39k

views

Formula that will repeat number X times and increased by a counter

I have the following problem: I need to repeat a given number, say 3 times. I then need to repeat the next number the same amount of times. So I need a formula to print, for instance, 111, 222, 333, 444 etc. each on a different row. Can this be done? Thanks.
wootscootinboogie
1

votes
3

answer
230

views

Delete one column on the criteria of another SQL Server 2008

One attribute in a table became corrupted after a certain point in a table of mine. I want to delete every pat_coun attribute if it has an ID that begins with 11 (number, not text). So I don't want to get rid of any of the records in the database, just clear out the attribute pat_coun if it's ID...
wootscootinboogie
1

votes
4

answer
207

views

Combining results with DateDiff included

I have a list of places where people have been discharged and I need to stratify them by age. The query that I have currently below works, but it lists every discharge type count, by every age. You can see how for age 0-1-2-3 there are all separate counts of discharge type based on what age. Ho...
1

votes
1

answer
75

views

Get day of the week from stored datetime

I've used this select datename(weekday,getdate()) to give me today's date, but if I use SELECT DATENAME(weekday,dob()) from myTable where dob is my stored field that I want to get the day or the week for, it gives me an error. Is there a way to do this easily?
1

votes
2

answer
7.8k

views

Add X number of years to a datetime variable SQL Server 2008

I need to add 10 years to the year portion of the date with date stored in the format yyyy-mm-dd for everyone who visited in the year 2010. Below is the query I want to try but I don't know how to use the rollback function of SQL Server yet. Visityear is varchar datatype. update myTable set admitda...

View additional