Experts,
I need to achieve the attached table snapshot.
It selects data from two different years, break them down into months and quarters. Shows totals of each month, then quarter, the...
Attached below is my sql query that is working fine. I would like to add a WHERE clause to show
WHERE a.docdate = 'last weekday'
If today is Monday then I would want it to show all rec...
Hello!
About my environment:
I have a hosted web database that I don't have access to other than with classic ASP and an ODBC connection that thankfully gives me both read and write access...
Please see the attached. Fig. 1 lists the raw data (two tables). Fig. 2 Shows the desired output.
Id like the output to merge the tables together, displaying the clients earliest start date...
We have an orders table that has a field called "sold_date" and another field called "rep_id"
Over a one month time period we want to see the AVERAGE number of days between sold_date and th...
I have a table, OLP_LEADS_MASTER
-I want to select all fields
-I only want records that are unique address/zip combinations (ADRS and ZIP fields), but I want to select the newest one based...
Hi
I have a quick question about SQL 2005. I want to use a select statement which returns the value of the first record in a specified field. In the old days you could use the "FIRST" sta...
Have the following Update Query:
UPDATE LINK INNER JOIN FORM_ID_358989923 ON LINK.TAG = FORM_ID_358989923.TAG SET FORM_ID_358989923.LOCATION = LINK!LOCATION;
In the LINK table, the Tag may...
Server: Msg 156, Level 15, State 1, Line 11
Incorrect syntax near the keyword 'then'.
If the value displayed is positive or negative then I want to put an 'X' in that field, else put a bla...
Im having some problems with this one... I need a report that generates a list of the last 12 months (from today, i.e. Sept 07 - Aug 08), then using a column of dates from a table, count how ...
I have a table scheme.opheadm, i want that when scheme.opheadm.[status] is updated to '9' that the trigger will insert fields from scheme.opdetm into another table, i have attached the my atte...
Hi,
having a table A which looks like
DATE CRIT1 CRIT2 CRIT3 X Y Z
1/1/1990 1/20/1990 ...
I'm trying to add additional Items via parameters to the where statement of my Select.
Here's what I've got so far..
Declare @ab varchar(50)
DECLARE @ac varchar(50)
DECLARE @ad varchar(5...
I have a question in concerns with counting rows. I have two tables
table1
CaseID, UserID, CaseTitle, CaseDescription
Table2
ID, CaseID, CaseNotes
How can I create a stored procedu...
The tbl EXPERIENCE has *many* records, as does the tbl PolicyTransaction. I am trying to update the zipcode column in EXPERIENCE with what is in PolicyTransaction (the zip in Exp are wrong). I...
I have an Acess 2003 table
I hve a total of 10 fields. I want to tkae two fields and match them up to another table with the same fields - if one field matches and the second field does not ...
Hello everyone,
I have a SQL query in a data source, and some VB code posted below - as I understand it, the query should give me the primary key value of the record that was just inserted....
Hi expert ;
My doubts:
1) Can i have Two MAX columns in SELECT statement?
2) HOW many MAX can i have in single table?
3) HOW many MAX can i have in single sql query?
One of my se...
I have a query which produces a number of calculated results, including some cumulative totals. The cumulative totals work by considering the field trxSeq (prior to running the query this is ...
hi everyone i have this query which gives me correct results but i want to change the season column to row header for example right now the query print the results as follow
BRANCH_CODE ...
I wrote a simple SQL view to display some values, here What I would like it todo:
if dbo.ICHIST.TRANSTYPE = 2 AND ICHIST.TRANSDATE < 20070322 then ICHIST.QUANTITY = 0 ' in the output
I use...
select top 10 statspartner.campaignid, statsc.campaignname, statspartner.partnerid, statspartner.pdate, statspartner.kw, statspartner.clicks, statspartner.actions, ((statspartner.actions / sta...
I have the following sql Select statement
SELECT a.ActivityId, a.CaseId, a.FirmId, a.ActType, a.ActDesc, a.DateInitiated, a.LastModified,
a.ProcesstepID,a.dateinitiated,b.Processtep + '/'...
I have a table that has a column called FileExtension.
I would like to know a SQL statement that would return two things. Extension and Total Count.
I basically want to group them by ex...
I am looking to find the number of weeks that have passed in the current year and divide them by the number of hits from the SQL script below. Anything greater than 1 I want to display (basic...