I can't seem to figure out how to code this into SQL:
Table 1
SubmitID, LastName, FirstName, StartDate, EndDate
1, Doe, John, 30/05/2008, 31/07/2008
2, Doe, John, 04/07/2008, 01/07/2008
...
Hi there, I dont know if this is possible:
I have two fields:
ShowName
Showdate
all the showdate fields are in datetime format but all of them only have the date ie:
15/08/2008 00:0...
I need to work out the number of working days between two dates (i.e. excluding Saturdays and Sundays) that are stored in a table.
I've found two ways to this, and have attached the sql for...
I need help with the following statement. I'm getting a syntax error and have tried to correct this everyway I know but still not right.
"SELECT * FROM dbo.CallTracking WHERE SRV_ADD LIKE '"...
I have been successful for quite a qhile using xp_smtp_sendmail to generate emails in SQL Server 2005. Now I have tried to add an attachment to the email, and the sproc fails with this error:...
Hi,
Is there anyway to have an update and insert in the same query. I have a table, I need to say something like,
If ID exists in other tbale, update field comment in other table to equal "A...
I am using the following update commands to search tables within the same database called Listings and clean up data. How do I combine this command to search for all of these strings on the e...
I have a stored procedure in SQL Server 2005 to execute a query on another SQl 2005 server .
The link works fine and no problems running a standard query but a query with parameter fails to ...
I have a select statement where I am multiplying 2 columns together, however it gives the "No Column Name" as the Column Identifier.
Is there away in my select statement to name that Column...
I am attempting to write a series of functions that each have 3 parameters (year, month and business unit). Each function will return the sum of a value for the entire year or a specific mont...
This problem is related to a question that was successfully answered a couple of days ago. Unfortunately the report requirements have since changed so I'm going to need a little more help.
Th...
Hi there
The query I've made belwo is returning all the correct data but the GROUP BY statement isn't working, it seems to be grouping some of the data...the picture should explain it a bit...
Hi,
I am looking for correct sql to compare date. I have my sql db table "users ". I am trying to get value from table where
last_password_change_date = any date when password for last cha...
Creating a query over 2 tables. Both have date fields and I'm summing 2 columns on each of them
I want the query to return
YEAR SUM(ADJ LOSS ADDITION) SUM(ADJ LAE ADDITIONS) SUM(EXP ...
Query 1:
select date, code, demand, total_demand from table_a
result :
date code demand
2008/07/01 aaa 10000
2008/07/01 bbb 2000
2008/07/02 bbb 3000
2008/07/02 ccc 4000
200...
Two tables, one called tblOffice the other called tblFactory.
Both tables have the following fields. FirstName, LastName, Birthday
I need to combine (join) both tables where the Birth...
Here is a case of tricky query that would need advice. A log of sales orders contains some data fileds, a unique sales order id and a unique customer id. However, the main customer table is ma...
Greetings Experts,
I am having a problem writing a query that joins 2 tables on 2 fields (no unique fields available) AND I also want to calulate the sum of individual fields after the tab...
Hello,
I have a table that I need to join with two other tables to pull in first and last names. Essentially what I want to do is add two columns to my main table (first and last name) and ...
The problem is associated with the merging of date ranges that exist in a table, Projects. The solution needs to produce a full merge of overlapping ranges for these dates (by client).
The ...
I have multiple tables within a database that all have a column called marketingRemarks that displays a string of text. In some cases the records have html code <marquee> inserted in the text...
I have a table full of people wihch is an attendance database. What I have to do is count the number of people each day and then sub count the types of Rnak that they are. So the iniatial co...
On my insert into my database i need to convert 2 dates to a string format to store in the DB. Curretnly they look like so 8/1/2008 I need this date to look like 01AUG2008. The firelds I n...
Hello,
I have two tables in an Oracle 10g database:
DOCUMENTS
-------------------------
document_id NUMBER PK
description VARCHAR2(100)
createdate DATE
DOCUMENTPAGES
------------...
Hi,
having two tables A and B.
A contains month end observations and looks like:
DATE CRIT1 CRIT2 X Y
12/31/1990 2/15/1991 ...