I have a query that works in Access. It pulls time in a format that is understood by Quickbooks. We are upgrading our access-based program to MSDE. I have tried 3rd party converters and searched Google, but I still cannot get the proper syntax down. I am posting my access query in SQL view.
SELECT
([Empfname] & " " & [Emplname]) AS Employee
,TimeEntry.TEdate
, IIf([Engrelated]<>"None",([Engrelated] & ":" & [Cltname]),([Cltname])) AS Client
, ServiceCodes.SCDesc
, ([TEhours]*360) AS [Time]
, TimeEntry.TEbillable
, TimeEntry.TEref
, Clients.Engrelated
FROM (Employee INNER JOIN (Clients INNER JOIN TimeEntry ON Clients.ID = TimeEntry.TECltID)
ON Employee.ID = TimeEntry.TEempID)
INNER JOIN ServiceCodes
ON TimeEntry.TECodeID = ServiceCodes.ID
GROUP BY
([Empfname] & " " & [Emplname]), TimeEntry.TEdate, IIf([Engrelated]<>"None",([Engrelated] & ":" & [Cltname]),([Cltname])), ServiceCodes.SCDesc, ([TEhours]*360), TimeEntry.TEbillable, TimeEntry.TEref, Clients.Engrelated;
I created this query in access using "Design View" I greatly appreciate any help.
Marshall
5 1640
try the following
SELECT
Empfname +''+ Emplname AS Employee
,TimeEntry.TEdate
,case when Engrelated !='None' then [Engrelated]+ ':' + [Cltname] else [Cltname] end AS Client
, ServiceCodes.SCDesc
, ([TEhours]*360) AS [Time]
, TimeEntry.TEbillable
, TimeEntry.TEref
, Clients.Engrelated
FROM (Employee INNER JOIN (Clients INNER JOIN TimeEntry ON Clients.ID = TimeEntry.TECltID)
ON Employee.ID = TimeEntry.TEempID)
INNER JOIN ServiceCodes
ON TimeEntry.TECodeID = ServiceCodes.ID
GROUP BY
([Empfname] +''+ [Emplname]), TimeEntry.TEdate, case when Engrelated !='None' then [Engrelated]+ ':' + [Cltname] else [Cltname] end , ServiceCodes.SCDesc, ([TEhours]*360), TimeEntry.TEbillable, TimeEntry.TEref, Clients.Engrelated
Thankyou for the reply.
Does !='None' mean not equal to None?
I am now getting a text,ntext, image type..... error
I researched and found that 1 of the columns i need data from is a "text" column. All I can find to do is recreate the column "varchar" but the problem is there is data in that column. Any suggestions? thankyou for all of your help.
EDIT
the error that I am getting says that text,ntext ...cannot be compared or sorted. the column is TimeEntry.TEref in my script. I do not need to compare it with anything. it is only a description of what work was done. If I remove it from GROUP BY, I get an error that it isnt needed in SELECT. I am new to this so my question is, Is there a way to display the column but not use "GROUP BY"
Does !='None' mean not equal to None?
No, "NOT EQUAL" operator is "<>".
Try to run following script, please post error message (if any): - SELECT distinct
-
Empfname +''+ Emplname AS Employee
-
,TimeEntry.TEdate
-
,case when Engrelated <> 'None' then [Engrelated] + ':' + [Cltname] else [Cltname] end AS Client
-
, ServiceCodes.SCDesc
-
, ([TEhours]*360) AS [Time]
-
, TimeEntry.TEbillable
-
, TimeEntry.TEref
-
, Clients.Engrelated
-
FROM Employee
-
INNER JOIN TimeEntry ON Employee.ID = TimeEntry.TEempID
-
INNER JOIN Clients ON Clients.ID = TimeEntry.TECltID
-
INNER JOIN ServiceCodes ON ServiceCodes.ID = TimeEntry.TECodeID
-
thankyou very much for your help.
The Query works if I leave off the Distinct. What is Distinct?
Also, my text colum "TimeEntry.TEref" only displays (MEMO) I will check this out further.
... What is Distinct? ...
Your query contains a GROUP BY clause that groups by all columns from SELECT clause. It means that you want to get rows with unique combination of values. That is exactly what DISTINCT does, so I removed GROUP BY clause and added DISTINCT.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andreas Lauffer |
last post by:
I changed from Access97 to AccessXP and I have immense performance
problems.
Details:
- Access XP MDB with Jet 4.0 ( no ADP-Project )
- Linked Tables to SQL-Server 2000 over ODBC
I used...
|
by: *no spam* |
last post by:
I want to move my Access 2K database into MSDE. The Access Upsizing
Wizard crashes (a known bug wi A2K), so I'm using the following
suggested method:
Access --> New --> Project (Existing...
|
by: Vikrant |
last post by:
Hey friends
Can someone please suggest that how many recordset can be opened
simultaneously for a MS-Access 2000 Database.Does that make any
difference if we use ODBC or some other way of...
|
by: swingingming |
last post by:
Hi, for 5 weeks, I finished my mdb project. Thanks to all you guys.
Now, I would like to put it on a server then 5-6 people can share it. I
heard about the splitting back-end database, put it on a...
|
by: Lokkju |
last post by:
I am pretty much lost here - I am trying to create a managed c++
wrapper for this dll, so that I can use it from c#/vb.net, however, it
does not conform to any standard style of coding I have seen....
|
by: Wolfgang Kaml |
last post by:
Hello All,
I have been working on this for almost a week now and I haven't anything up
my sleeves anymore that I could test in addition or change....
Since I am not sure, if this is a Windows...
|
by: baramee |
last post by:
I develop web application by asp.net with ms access.
In general , it work fine.
But if hit rate of web is very much, it occure error 'Unspecified error'.
it error on conn.open.
My code will be...
|
by: Dan V. |
last post by:
Since an ASP.NET/ADO.NET website is run on the server by a single "asp_net
worker process", therefore doesn't that mean that even 50 simultaneous human
users of the website would appear to the...
|
by: Eva |
last post by:
Can anyone plz direct me on a useful article on upgrading
my access databae to a msde database.
I also have a question. is msde a dbms just like access?
is it simple to use like access?
I...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |