Can't Make New Record (query)

Dec 14, 2007

Hello,

I'm a bit new to MS-SQL so i thought maybe you could help me.

This is my prob. I have an Access application that i have upsized to a MS-SQL server. I have a query based on 3 tables: Customers, Companys and Payreminders. When i run this query, i can't add new records or make any changes.
If i only run the query with the tables: companys and payreminders i can add new records and edit them. If i run a query that's based on companys and customers, i can edit and add new records, but when i run the query based on companys and customers i can't add or edit records.

companys, payreminders: Editable
payreminders, companys: Editable
Companys, customers: Non editable
Companys, payreminders, customers: Non editable


Something must go wrong when i use the companys and customers table. Can anybody help or give a suggestion what to do.

Thanks.

View 1 Replies


ADVERTISEMENT

Ways To Make This Work: Several Selectable Related Record For One Main Record.

Apr 6, 2007

Hey all!



Sorry for the less then descriptive post title but I didn't find a better way to describe it. I'm developing an app in the express editions of VB and SQLserver. The application is a task/resource scheduler. The main form will have a datepicker or weekly overview and show all tasks scheduled per day. The problem is, I've got one or more people assigned to tasks and I wonder what's the best way to design this. Personally, I'd go for one Task table, a People table and a table that provides a link between them (several record per task, one for each person assigned linking TaskID and PplID). However, I don't see a nice way of showing this data to the end user, allowing him to edit/add etc on ONE screen.

To fix that the only way I see is just add columns to the Task table for every person with select boxes. This way everything can be done on one simple screen. This obviously does present some future issues.

On top of this, which people are available on a day varies and there should be an option to allow a user to set who is available on a specific day. Which would lead me to my first idea and add another table that would provide this. but then I'm having design issues again for the form.



I'm kinda stuck atm, can anyone shed some light on this. I'm sure there is an elegant way of doing this but I'm failing at finding it.



Thanks in advance,

Johan

View 5 Replies View Related

How To Make 1 Record?

Nov 20, 2007



I have an SSIS package (SQL Server 2005) that gathers statistics (ie total records created, items created, items shipped, etc). I have made a UNION query to get the data (because it has to look at different date fields) that returns the following results:
ID QTY
Created 20
Shipped 30
Received 35

What I what to do is store this data as 1 record like this:
Date Qty_Created Qty_Shipped Qty_Received
11/20/2007 20 30 35

How can I accomplish this?

Thanks

View 4 Replies View Related

How Do I Make Sure Only One Record Is Checked?

Jun 22, 2007

I have a table of magazine issues. The table are defined as below:



issueID int Unchecked
name varchar(50) Unchecked
title varchar(100) Checked
description varchar(500) Checked
crntIssue bit Checked
archived bit Checked
navOrder int Checked
dateCreate datetime Checked



And here is what I want. Is there a way when inserting/updating or on the table itself to make sure that there is only one record that is marked as the current issue? The way I have it here in my table, any records can have the current issue (crntIssue) field checked. I only want one crntIssue field checked regardless of how many records or issues are in the table. If there is no way to automatically have SQL Server to manage that then that means I must check all the records before hand before the update/insert query, correct?

View 23 Replies View Related

How Do I Make Sure Only One Record Is The Current Issue?

Jun 22, 2007

I have a table of magazine issues. The table are defined as below:
issueID    int    Uncheckedname    varchar(50)    Uncheckedtitle    varchar(100)    Checkeddescription    varchar(500)    CheckedcrntIssue    bit    Checkedarchived    bit    CheckednavOrder    int    CheckeddateCreate    datetime    Checked
And here is what I want. Is there a way when inserting/updating or on the table itself to make sure that there is only one record that is marked as the current issue? The way I have it here in my table, any records can have the current issue (crntIssue) field checked. I only want one crntIssue field checked regardless of how many records or issues are in the table. If there is no way to automatically have SQL Server to manage that then that means I must check all the records before hand before the update/insert query, correct?

View 9 Replies View Related

Question To Make A Sinlge Record As Two

Feb 14, 2008

HI if I have a recrod in a plain text file , and it has some colums information including FromDate and ThruDates if the date range is over 30 days, Then the record should split and becomes 2 records rather then one.

for example:
if i have MemberID=255 FromDate 07/01/06 and ThruDate = 08/25/06

than
that single record should be saved as two records

like
Record#1 FromDate ThruDate MemberID
1 07/01/06 07/30/06 225
2 08/31/06 08/25/06 225

Well the file is a fixed length file.
On a web page. Page is uploaded.
when the fixed length file is uploaded it converted into the xml file.
After the xml file goes through the validation, it gets ready for the database.
Each field in the fixed length file was a xml node and sent to the database.

Now what I have to check from the sqlManagement studio. Insert a query with the test query as I decribed earlier, and instead of it get to the database it should be splited into two record instead of one and get in the database table. And if dates are in between 30 days, then the recrod go into table with out any other issue.

View 2 Replies View Related

Make A Database Record Read Only?

Oct 22, 2007



Hi.

I have a table where I need to set some rows to Read only (to protect the rows from being edited). Can I do this with a trigger checking against a column (where dataReadOnly = 1)?

Or is there a better way?

thankyou

View 6 Replies View Related

How To Make Automated Update On The Previous Record...

May 9, 2008

Hello...i have a table that record all the reading meter....so when i change one of the reader meter data...in logical it will automatically change the normalized fields...

Reading teble
-------------------
-id[PK]
-meter
-normalized
-date
when i insert new record..i just insert data about date and meter...an normalized is automated calculate using my function..the problem is..when i have data more than one...when i try insert or update or delete data...it nee to be automatically calculate back the normalized..i know this is needed the temperory table and then reinsert back..how can i solve this problem???

View 1 Replies View Related

How To Make A Trigger Refer To The Current Record

Jul 8, 2004

I have a table full of items that have a "date_updated" field. I'd like this field to be set to GETDATE() whenever a record is updated. I've got this trigger:

CREATE trigger tr_cp_shiptos_u on dbo.cp_shiptos for update as
update cp_shiptos set date_updated = GETDATE()

Problem is, of course, there's no WHERE clause..yet. I don't know how to refer to the record that was updated.... for example:

CREATE trigger tr_cp_shiptos_u on dbo.cp_shiptos for update as
update cp_shiptos set date_updated = GETDATE()
where shipto_id = @THIS_ID

I imagine there's some kind of builtin variable or something like that. How is this done?

Thanks in advance.

View 2 Replies View Related

Need Advice On Best Way To Make Dbase Record Updates

Jul 23, 2005

Approximately once a month, a client of ours sends us a bunch ofcomma-delimited text files which I have to clean up and then importinto their MS SQL database. All last week, I was using a Cold Fusionscript to upload the cleaned up files and then import the records theycontained into the database, though obviously, the process tookfriggin' forever, and could have been done 500x quicker had I done itdirectly on the server. My SQL knowledge is somewhat limited, however,so I had no choice but to stick to what I know, which is Cold Fusionprogramming.In the process of cleaning up some of these comma-delimited text files,I inadvertently messed up some of the 10-digit zip codes, by applyingthe wrong Excel formula to the ZIP columns. These records were importedinto the database with obviously incorrect zip codes (ie: singledigit). So now, I have to find the best and quickest way possible tocompare these records in the database (that have the single digit zipcodes) with the unmodified data, and to update the zip codes with thecorrect data.I've had no luck setting up a TEXT file as an ODBC datasource, -- soI've ruled that out completely. I've also managed to import theunmodified data into an Access database, and to set it up as a ColdFusion datasource. But it seems this 2nd road I've been traveling downis not the ideal approach either.My question is, -- assuming that I'll be able to import the recordsfrom the Access database into their own table on the SQL server, -- howshould I go about the process of updating these records that have theincorrect zip codes?Here is the specific logic I would need to employ:* Here is a list of records, each of which contains an incorrect1-digit zip code (Database A / Table A)* Here is a much longer list of records (which contains all of therecords from Database A / Table A + thousands more), each of whichcontains a correct 5-digit zip code (Database B / Table B)* Compare both lists of records and run the following query/update:When a record in Database A / Table A has matching "name", "address1",and "address2" values as a record in Database B / Table B -- update therecord in Database B / Table B with the zip code from the matchingrecord in Database A / Table A.Would anyone care to write a sample query for me that I could rundirectly on the SQL server, or at least give me some pointers?The specific field names are as follows:name,address1,address2,city,state,zipThanks in advance!- yvan

View 5 Replies View Related

How To Make Form To Delete Record From Table In Access 2002

Jun 29, 2004

I like to give First Name and Last Name in two different text box and then hit the delete button (command button). Then it will do a query to find the person and delete the corresponding record from the table. Any kind of help will be appreciated. Thank you.

View 1 Replies View Related

Query Timeouts When Updating A Record Retrieved Through A Websphere JDBC Datasource - Possible Record Locking Problem

Apr 7, 2008

Hi,

We're running a Sage CRM install with a SQL Server 2000 database at the back end. We're using the Sage web services API for updating data and a JDBC connection to retrieve data as it's so much quicker.

If I retrieve a record using the JDBC connection and then try and update the same record through the web services, the query times out as if the record is locked for updates. Has anyone experienced anything similar or know what I'm doing wrong? If I just use DriverManager.getConnection() to establish the connection instead of the datasource, and then continue with the same code I don't get these record locking problems. Please find more details below.

Thanks,
Sarah

The JDBC provider for the datasource is a WebSphere embedded ConnectJDBC for SQL Server DataSource, using an implementation type of 'connection pool datasource'. We are using a container managed J2C authentication alias for logging on.

This is running on a Websphere Application Server v6.1.

Code snippet - getting the record thru JDBC:


DataSource wsDataSource = serviceLocator.getDataSource("jdbc/dsSQLServer");
Connection wsCon = wsDataSource.getConnection();


// wsCon.setAutoCommit(false); //have tried with and without this flag - same results

Statements stmt = wsCon.createStatement();


String sql = "SELECT * FROM Person where personID = 12345";
ResultSet rs = stmt.executeQuery(sql);


if(rs.next()){
System.out.println(rs.getString("lastName"));
}

if (rs != null){
rs.close();
}
if (stmt != null) {

stmt.close();
}
if (wsCon != null) {

wsCon.close();
}

View 1 Replies View Related

How To Create A Make-Table Query With A Union Query

Oct 30, 2006

I have successfully execute a union query. How can i create a make-table query to accomodate the resultset of the union query?

View 2 Replies View Related

Need To Make This Query

Jun 28, 2004

Hi guys, I have a car_race table which has these fields

car_id int
race_id int
b_car_won varchar // can have 'y' or 'n'

I need to know if the car lost the 1st race but won the next race

And example of that table for car_id 1:

car_id 1
race_id 1
b_car_won 'NO'

car_id 1
race_id 2
b_car_won 'YES'

Now this is the tricky part, the database has some data integrity issues, so this can occur:

car_id 1
race_id 1
b_car_won 'NO'

car_id 1
race_id 3
b_car_won 'YES'

So I cant used a fixed race_id value, need to use the race_id > 1 to know whats the next race. But this raises another issue if I have this in the database:

car_id 1
race_id 1
b_car_won 'NO'

car_id 1
race_id 3
b_car_won 'YES'

car_id 1
race_id 4
b_car_won 'YES'

If I query I'd get 2 rows where race_id > 1. And I only need the first one, because 3 is the next race.

I need to fetch in a single row if possible, the result of the 1st race and the 2nd race. How can I do this?

View 11 Replies View Related

How To Make Query Look Better

Aug 28, 2007

select contractnbr,affcontractnbr,tdd,affrtramount,affturn,
pt=datediff(d,afffirstfundingdate,affRTRBalanceZeroDate),ratio=datediff(d,afffirstfundingdate,affRTRBalanceZeroDate)/afftrun
from #targetfinishedaff

datediff(d,afffirstfundingdate,affRTRBalanceZeroDate) appears two times in this code, Is there a way to make it appear only once?
Thx

View 1 Replies View Related

How To Make This Query?

Feb 14, 2008

I want to make query for average sales price, the records are like this

item, Sales_qty, UnitPrice
A, 10, 1000
A, 20, 1100
A, 5, 1500
B, 1, 1000
B, 2, 1200

and display like this
A, 35, 1128 (35 FROM total qty, 1128 from average sales price)
B, 3, 1133

Thanks in advance

View 8 Replies View Related

Make Two Query In Too One

Jul 20, 2005

I have two SQL query that I would like to make in to one, if possibleHere is the first one: (Query4)SELECT rooms.DESCRIPTIO, rooms.ID, bookings1.DATEFROM bookings1 INNER JOIN rooms ON bookings1.ROOMID = rooms.IDWHERE (((bookings1.DATE) Between #4/3/2004# And #4/9/2004#));And the second one:SELECT rooms.ID, rooms.DESCRIPTIO, Query4.ROOMIDFROM rooms LEFT JOIN Query4 ON rooms.ID = Query4.ROOMIDWHERE (((Query4.ROOMID) Is Null));Is it possible to make one query of this two?With the same result.

View 3 Replies View Related

How Can I Make Such Query?

Jan 9, 2008

I havea textbox for searching by patient name but now and though I am searching with LIKE% i can only search for exact string, for example if user typed JASSIM it will search for field full_name LIKE '%JASSIM%" ad if user typed JASSIM RAHMA it will search for full_name LIKE '%JASSIM RAHMA%' but i want to search if the field CONTAINS '%JASSIM% AND %RAHMA% when the user types JASSIM RAHAM in the textbox

View 4 Replies View Related

How To Make This Query...

Sep 16, 2007




Hi all. I have tried making this query for a while and i didn't manage to.
I know it is something related to JOIN, but i didn't manage to make it work :
I have two tables.
Table1- db_stockprices
Table2- db_stockSymbols

db_stockprices is getting updated every day with stock daily prices.
db_stockprices looks like:
ID, SymbolID, Price,Date
1 1 33.21 1/1/2007
2 1 33.14 1/2/2007
3 1 34.21 1/3/2007
4 2 11.42 1/1/2007
5 2 11.73 1/2/2007
6 3 18.32 1/1/2007
7 3 19.11 1/2/2007
8 3 18.41 1/3/2007
9 4 52.44 1/1/2007

and so on for all the stocks.
ID is Primary Key
SymbolID is related to SymbolID in db_stockSymbols which contains all the stock information.

What i am trying to do is an SQL QUERY that will delete all same SymbolID Rows if a specific INPUT date do not exist within that SymbolID.

Example:
If the INPUT date for the query is 1/3/2007 all rows with SymbolID "2" abd "4" will be deleted since 1/3/2007 does not exist in SymbolID "2" and "4". Moreover, the row in db_stockSymbols with SymbolID "2" and "4" will also be deleted.


Is this possible within 1 SQL Query?
I would really appreciate a good query example for this example..

View 13 Replies View Related

Need Help To Make Query

May 11, 2006

Dear member

Hi

I have a problem,

I have a table for my company name and another for cities.

I have a table Company_City to indicate that each company has office in each city

For example

company X in city A company Y in city B

company X in city B company Y in city H

company X in city C

I want make a query to retrieve companies that have office in city A and B. so company Y that has office in B only should not retrieved in my query.

If i use "IN" operator(by subquery from city table) in my WHERE Clouse the result will be A,B.

Can you help me?

View 4 Replies View Related

How To Make The SSMSE To Return Whole Records Without Any Close Query Form And Re-create Query Form Operation?

Dec 25, 2007

Hi,
I got a problem.
I installed Microsoft SQL Server Management Studio Express 2005 version.
And I created a Compact database.
I created an connection in SSMSE to connect the database and opened a query form.
then, i run the following sql:

Select * from Table1

It returned 3 records to me.
After that, I used program to insert record into this table.
Then i ran this sql again, it still show me 3 records.
I closed the query form, and re-created a new query form, then run the sql, it returned 4 records to me.

Why? It's very strange and difficult to operate, right?
Is there anyone know how to make the SSMSE to return whole records without any close query form and re-create query form operation?

Thanks a lot!

And Merry X'max!!!

View 4 Replies View Related

Can't Seem To Make This Query Work

Jul 24, 2006

Hi,
I have a query thatI need to make into one query for the sake of an application reading only one cursor.
 
Here's the syntax:
select (select distinct(x.amount) from escrow k inner join e120 x on k.escrow = x.escrowinner join a10 g on x.escrow = g.escrow  where k.ftype = 'S' group by x.amount, g.officer) As New,a.officer as Officer, count(distinct(j.fstatus))as Escrow_Type, count(distinct(j.amount))as Amount, count(distinct(d.open_date))as [Open], count(distinct(d.close_date)) as Closed, count(distinct(can_date))as Cancelled
from a10 a inner join escrow d on a.escrow = d.escrowinner join e120 j on j.escrow = d.escrow where j.id_scr = 'e21' and j.fstatus = 'PAID' group by a.officer
 
The error message i'm recieving is the following:
 
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
 
Any ideas? any suggestions would be great.
 
Thanks

View 3 Replies View Related

Need To Make Complex Query

May 3, 2005

I have table 'OrderTab' in Sql Server database which have Company Number,ContactId,Quantity fields and data in tables are in following format.
Company ContactId QuantityNumber100001    101           1100001    102           2100001    103           9100001    104           8100001    105           4100001    106           3100001    107           2100001    108           1100001    109           3
 
I need to create the query and want the result in following format.
CompanyNumber |MaxQuantityContactId |MaxQuantity| MinQuantityContactId |MinQuantity100001                       103                        9                    101                        1
Where MaxQuatityContactId  = ContactId which has order max quantityMaxQuantity = max quantity  order by single company(100001)
MinQuatityContactId  = ContactId which has order min quantityMinQuantity = min quantity order by single company (100001)
Any idea how to do that.
Thanks in AdvanceArvind

View 7 Replies View Related

Help Make Query Run Better (faster)

Mar 20, 2007

I need help makeing the following query run more efficently.


Code:


SELECT t1.ID,t1.firstName,t1.lastName,t1.address,t1.city,t1.state, t1.zip,t1.locationAddress,t1.locationCity,t1.locationState,t1.locationZip
FROM Landlord_tbl t1
left outer join Mail_tbl t2
ON t2.potentialSitesID = t1.potentialSitesID
WHERE t2.mailed_out_date is null and NOT(t1.firstName+t1.lastName) is Null
GROUP BY t1.ID,t1.firstName,t1.lastName,t1.address,t1.city,t1.state, t1.zip,t1.locationAddress,t1.locationCity,t1.locationState,t1.locationZip
ORDER BY t1.firstName, t1.lastName, t1.city, t1.state

View 3 Replies View Related

Please Help Make Pivot Query

Sep 26, 2007

I have tbWarehouseStock, contain
WHCode Item Stock
------ ------ -----
WH001 Pencil 10
WH001 Pen 10
WH002 Pencil 5
WH003 ruler 100

How to make pivot query like this, I am thinking of dynamic SQL but dont know how to do this

Item WH001 WH002 WH003 WH004 WH005 ....
------ ----- ----- ----- ----- -----
Pencil 10 5 0
Pen 10 0 0
Ruler 0 0 100

thanks

View 3 Replies View Related

How To Make Row Calculated Query.

Apr 1, 2008

Please help me to get the result I want.

I have this table.
Date Value
=== ====
1-Jan 100
1-Jan 80
1-Jan 20
2-Jan 50
2-Jan 30
2-Jan 5
2-Jan 15
3-Jan 120
3-Jan 80
4-Jan 45
4-Jan 55
5-Jan 120

How do I write the query to get the following result from above table.

Date Opening Value Closing
1-Jan 0 200 200
2-Jan 200 100 300
3-Jan 300 200 500
4-Jan 500 100 600
5-Jan 600 120 720

Where, Opening column is 0 when there is no previous closing and Value column would be the daily total. The closing would be the Opening value + Daily Total and this value would Opening value for next line. Please help me how to write the SQL statement to get this result from above table.

Thanks in Advanced,
AV

View 3 Replies View Related

How Make MDX Query Return Something Rather Than Nothing?

Sep 28, 2007

Hi


I have encountered some problems creating MDX query.
There are two input parameters on report, both dropdown list and from query.
The first parameter will check "State", and the second parameter "Store Name" depends on previous' result.
If there's no "State" found, I manage to show a "No Data" in the "State" droplist.
But with "No Data" in first parameter, the second parameter simply is not enabled.
I want the second parameter shows " No Data" as well but not succeed.


Here's code

...

SELECT {[Measures].[A1], [Measures].[B1], [Measures].[C1]} ON COLUMNS ,

[Store].[Store Name].ALLMEMBERS ON ROWS
FROM ( SELECT ( STRTOSET(@State) ) ON COLUMNS FROM [Cube])
...
The query need to look at dataset that contains [store name] on rows, and some measures on columns.
It also restricted by parameter @State.

Store Name that satisfies @State will be displayed.
But if nothing from SELECT ( STRTOSET(@State) ) ON COLUMNS FROM [Cube], there's nothing in result.
I'd rather like show something rather than nothing.
I try codes like
...
MEMBER [Store].[Store].[NA] AS '"N/A"'
IIF(<Parameter empty>,
(SELECT ... ON COLUMNS, [Store].[Store].[NA] ON ROWS FROM ...),
(SELECT ...<Original statement >)
)
...
It shows "Subselect support only Column axis".

Any one has an idea?
Please help me out
Many thanks!


Mr. L


View 1 Replies View Related

How To Make Table Relations Using Query.

Mar 18, 2004

.

Hi,

How can I make relations between two tables using query? Tables are already there with data.

Regards

View 3 Replies View Related

How To Make A Random Order Query ?

May 1, 2004

If we use: select * from ..... , normally, it will return an ordered result ( may be order by ID ), but how can we make an random order select statement. It mean every time we run the query, the result will be different from the other ?

View 1 Replies View Related

Any Clue To Make This Query Run Faster

Oct 3, 2006

Any help would be really appreciated....
My stored procedure...




CREATE PROCEDURE business3rd7
@Fromdate DATETIME,
@ToDate DATETIME
AS



select distinct CONVERT(VARCHAR(10),Receipts.Companynumber1)+CONVE RT(VARCHAR(10),Receipts.Companynumber2) as co ,
Receipts.Premium1+Receipts.Premium2 as Premium,
"CAN"=case when Receipts.transactiontype='CAN'
then (receipts.premium1+receipts.premium2)
else 0
end,
"NET"=Receipts.Premium1+Receipts.Premium2-case when Receipts.transactiontype='CAN'
then (receipts.premium1+receipts.premium2)
else 0
end,

"#NEW"=case when Receipts.transactiontype='NEW' then count(Receipts.policynumber) else
0 end,

-------
"$NEW"=
case when Receipts.transactiontype='NEW' then (Receipts.Premium1+Receipts.premium2)
else 0 end,
"#REN"=case when Receipts.transactiontype='REN' then count(Receipts.policynumber) else
0 end,
"$RENEW"=
case when Receipts.transactiontype='REN' then (Receipts.Premium1+Receipts.premium2)
else 0 end,
"#AP"=case when Receipts.transactiontype='AP' then count(Receipts.policynumber) else 0
end,
"$AP"=
case when Receipts.transactiontype='AP' then (Receipts.Premium1+Receipts.premium2) else
0 end,
"#SENT"=case when policy.Renewalofferdate between @Fromdate AND @ToDate then
count(policy.policynumber) end,

"%"=case when case when Receipts.transactiontype='REN' then count(Receipts.policynumber)else 0
end =0 then 0
when case when policy.Renewalofferdate between @Fromdate AND @ToDate then
count(policy.policynumber) else 0 end=0 then 0
else
case when Receipts.transactiontype='REN' then count(Receipts.policynumber)else 0
end /case when policy.Renewalofferdate between @Fromdate AND @ToDate then
count(policy.policynumber) else 0 end end,


"Current Year"= case when policy.Renewalofferdate between @Fromdate AND @ToDate then
count(clubamount) end,
"Previous Year"=case when policy.Renewalofferdate between DateAdd(year, -1, @Fromdate)
AND DateAdd(year, -1, @ToDate) then count(clubamount) end,
"#AA"=count(receipts.clubamount),
"$AA"=sum(receipts.clubamount)

FROM Receipts,Policy
where Receipts.Agencyid=Policy.Agentid
group by
Receipts.CompanyNumber1,Receipts.CompanyNumber2,
Receipts.Premium1,Receipts.Premium2,
Receipts.TransactionType,policy.Renewalofferdate,
Receipts.Agencyid



GO


Query plan...

----------------------Query Plan

|--Sort(DISTINCT ORDER BY:([Expr1008] ASC, [Expr1009] ASC, [Expr1010] ASC, [Expr1011] ASC, [Expr1012] ASC, [Expr1013] ASC, [Expr1014] ASC, [Expr1015] ASC, [Expr1016] ASC, [Expr1017] ASC, [Expr1018] ASC, [Expr1019] ASC, [Expr1020] ASC, [Expr1021] ASC, [Ex
|--Compute Scalar(DEFINE:([Expr1008]=Convert([Receipts].[CompanyNumber1])+Convert([Receipts].[CompanyNumber2]), [Expr1009]=[Receipts].[Premium1]+[Receipts].[Premium2], [Expr1010]=If ([Receipts].[TransactionType]='CAN') then ([Receipts].[Premium1]+[R
|--Compute Scalar(DEFINE:([Expr1004]=Convert([Expr1076]), [Expr1005]=Convert([Expr1077]), [Expr1006]=Convert([Expr1078]), [Expr1007]=If ([Expr1078]=0) then NULL else [Expr1079]))
|--Stream Aggregate(GROUP BY:([Receipts].[CompanyNumber1], [Receipts].[CompanyNumber2], [Receipts].[Premium1], [Receipts].[Premium2], [Receipts].[TransactionType], [Policy].[RenewalOfferDate], [Receipts].[AgencyID]) DEFINE:([Expr1076]=COUN
|--Sort(ORDER BY:([Receipts].[CompanyNumber1] ASC, [Receipts].[CompanyNumber2] ASC, [Receipts].[Premium1] ASC, [Receipts].[Premium2] ASC, [Receipts].[TransactionType] ASC, [Policy].[RenewalOfferDate] ASC, [Receipts].[AgencyID] ASC))
|--Hash Match(Inner Join, HASH:([Policy].[AgentID])=([Receipts].[AgencyID]), RESIDUAL:([Policy].[AgentID]=[Receipts].[AgencyID]))
|--Table Scan(OBJECT:([gasInquiry].[dbo].[Policy]))
|--Table Scan(OBJECT:([gasInquiry].[dbo].[Receipts]))



The two tables has number of records as 13349 and 97032.It taking more than 30 mins...
Any way to make it faster...

View 14 Replies View Related

How To Make Two Separate Query Work Together

Oct 15, 2014

I am currently stuck on how to make this 2 separate query work together, both work as i want them to individually, please note the syntax is according to a application i use that uses mysql to manipulate columns in an imported csv file.

CONCAT('at-',
REPLACE([CSV_COL(18)],'http://www.homebuy.co.uk/product.php/','')
)
removes last character i.e. /
SUBSTRING([CSV_COL(18)], 1, CHAR_LENGTH([CSV_COL(18)]) - 1)

basically i need these 2 to work together to give me an output like this

at-09fd8903

from the this. URL...url above minus the "" as i said both work on there own, but not together.

View 1 Replies View Related

WHAT DO I USE TO MAKE A TODAY DATE QUERY

Jul 23, 2005

select no_dossier from dbo.membre where date_MAJ = GETDATE()select no_dossier from dbo.membre where date_MAJ = '2005-07-21'Both should give me the same result, yes or no?thanks

View 1 Replies View Related

WHAT DO I USE TO MAKE A TODAY DATE QUERY?

Jul 23, 2005

select no_dossier from dbo.membre where date_MAJ = GETDATE()select no_dossier from dbo.membre where date_MAJ = '2005-07-21'Both should give me the same result, yes or no?thanks

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved