473,321 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

SQL Query Assistance

Hi

We are using Microsoft CRM and we have exported a list of service activities to a dynamic Excel worksheet. I have attempted to insert the name of customers that are related to service activities in the worksheet. When editing the SQL query I used the following script;

SELECT activitypartycustomer.partyidname,
serviceappointment.subject ,
serviceappointment.scheduledstart ,
serviceappointment.scheduledend ,
serviceappointment.regardingobjectidname ,
serviceappointment.activityid ,
serviceappointment.scheduleddurationminutes ,
serviceappointment.serviceidname
FROM FilteredServiceAppointment as serviceappointment
INNER JOIN FilteredActivityParty as activitypartycustomer
ON serviceappointment.activityid = activityparty.activityid
WHERE (serviceappointment.scheduledendutc >= dbo.fn_BeginOfLastMonth(GetUTCDate()) and serviceappointment.scheduledendutc < dbo.fn_EndOfLastMonth(GetUTCDate()) and serviceappointment.ownerid = N'{4DEA2FCF-D238-DB11-A907-00137259CAFC}')

It seemed to be successful however the partyid column contained the name of the owner of the service activity and below that row the name of the customer.

I am sure it is the ON statement that is giving problems. I would really appreciate any assistance.

Thanks
M
Jul 1 '08 #1
1 1155
debasisdas
8,127 Expert 4TB
I don't think there is any error with the query . It does what it is being asked to do in the syntax. If your requirment is different you might need to change the join part . It is really difficult to predict without the table structure.
Jul 2 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the...
4
by: DBNovice | last post by:
I have a database that keeps records on the issue and failure of an item. Currently, the database is poorly desisned; therefore I'm performing queries to break the data into normalized tables and...
5
by: Bill | last post by:
Good Day; I would appreciate assistance developing a query that I haven't been able to develop without using a second table. I wish to count the number of records that are still open on the...
4
by: MLH | last post by:
I apologize in advance to forum readers noticing this somewhat redundant post. I fear that my Subject Heading was ill-chosen in earlier post I made on this topic. Am hoping that a clearer Subject...
1
by: Dalan | last post by:
I'm experiencing a Query Syntax Error with an Access 97 Db. Actually, the query performs as expected when adding any new records or editing existing ones and even deleting records, EXCEPT when the...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
2
by: cory.craig | last post by:
I am trying to pull some "notes" from a sql database.....the notes that are put into the database come via the web and the user is entering it for a certain task. they are stored in their own...
28
by: Mark Braithwaite | last post by:
Hi We are attempting to create a dynamic spreadsheet which will extract information from CRM / SQL. We have very limited expierence in creating SQL queries and we would really appreciate any...
2
by: tomisin | last post by:
Hi Everyone, Please, I am currently working on an Access Project and any assistance from this forum would be appreciated. I developed some forms in MS-Access 2000 and I am currently using them to...
1
by: csolomon | last post by:
Hello: I am using two queries to get one result set. The issue is, I return no data when I combine them into one query. I have listed both queries, as well as the 3rd query that shows them...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.