473,406 Members | 2,867 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,406 software developers and data experts.

quotes on B/E of access converting to sql server

46
I've created a button that I want to produce a report in Access. The code goes as follows:
Dim sqltext As String
sqltext = "SELECT interviewdate,candgroup,lastname,firstname,middlen ame," & _
"program,s.roomno,dbo.idtoname(eid) AS interviewer,title,intdatetime " & _
"FROM InvwCandidate c, InvwSchd s, InvwInterviewer i , InvwInterviewerSchd v" & _
"where c.candrecno=s.candrecno" & _
"and v.recno = s.invwschrecno" & _
"and v.invwerID=i.invwerID" & _
"and c.acyear=" & Me.ComboAcYear & _
Switch(Me.ComboProgram = "M", " and program='M'", Me.ComboProgram = "P", " and program='P'") & _
" and InterviewDate between '" & Me.ComboFromDate & "' and '" & _
Me.ComboToDate & "' ORDER BY InterviewDate,intdatetime,lastname,firstname"
Debug.Print sqltext
************************************************** ***************
When I do a crtl G to look at the code, it returns:
SELECT interviewdate,candgroup,lastname,firstname,middlen ame,program,s.roomno,dbo.idtoname(eid)
AS interviewer,title,intdatetime FROM InvwCandidate c, InvwSchd s, InvwInterviewer i , InvwInterviewerSchd vwhere c.candrecno=s.candrecnoand v.recno = s.invwschrecno
and v.invwerID=i.invwerIDand c.acyear=2008
and program='M'
and InterviewDate between '11/13/2007' and '11/13/2007'
ORDER BY InterviewDate,intdatetime,lastname,firstname
************************************************** ************************
notice it combines the letter 'v' as the nickname for the table InvwerInterviewerSchd and the word 'where' and then it does it again with the word 'and' and the word right before 'and', s.candrecno.

I think its a quote issue, but it looks correct to me. Please advise me on how to get rid of the two words combining.
Thanks,
t
Oct 30 '07 #1
1 984
Stwange
126 Expert 100+
I've created a button that I want to produce a report in Access. The code goes as follows:
Dim sqltext As String
sqltext = "SELECT interviewdate,candgroup,lastname,firstname,middlen ame," & _
"program,s.roomno,dbo.idtoname(eid) AS interviewer,title,intdatetime " & _
"FROM InvwCandidate c, InvwSchd s, InvwInterviewer i , InvwInterviewerSchd v" & _
"where c.candrecno=s.candrecno" & _
"and v.recno = s.invwschrecno" & _
"and v.invwerID=i.invwerID" & _
"and c.acyear=" & Me.ComboAcYear & _
Switch(Me.ComboProgram = "M", " and program='M'", Me.ComboProgram = "P", " and program='P'") & _
" and InterviewDate between '" & Me.ComboFromDate & "' and '" & _
Me.ComboToDate & "' ORDER BY InterviewDate,intdatetime,lastname,firstname"
Debug.Print sqltext
************************************************** ***************
When I do a crtl G to look at the code, it returns:
SELECT interviewdate,candgroup,lastname,firstname,middlen ame,program,s.roomno,dbo.idtoname(eid)
AS interviewer,title,intdatetime FROM InvwCandidate c, InvwSchd s, InvwInterviewer i , InvwInterviewerSchd vwhere c.candrecno=s.candrecnoand v.recno = s.invwschrecno
and v.invwerID=i.invwerIDand c.acyear=2008
and program='M'
and InterviewDate between '11/13/2007' and '11/13/2007'
ORDER BY InterviewDate,intdatetime,lastname,firstname
************************************************** ************************
notice it combines the letter 'v' as the nickname for the table InvwerInterviewerSchd and the word 'where' and then it does it again with the word 'and' and the word right before 'and', s.candrecno.

I think its a quote issue, but it looks correct to me. Please advise me on how to get rid of the two words combining.
Thanks,
t
The problem here is that the &_ only concatenates the strings on the two lines
as though there was no gap between the last character of the first string and the first character of the second string. All you need to do is add a space to either the end of the first string or the beginning of the second string.
Eg.
Expand|Select|Wrap|Line Numbers
  1. " and v.recno = s.invwschrecno" & _
  2. " and v.invwerID=i.invwerID" & _
  3.  
hope this helps.
Oct 31 '07 #2

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

Similar topics

20
by: John | last post by:
Hi, I've recently upgraded from Access 97 to Access 2002 & the performance basically stinks. I have tried the following items listed below but it has only had a minor impact: 1) Upgraded Jet...
7
by: Dana Shields | last post by:
I am attempting to upsize from access to SQL Server. I'm trying to convert my queries to SQL Server views; however, I'm having a lot of difficulty with the syntax differences. For instance, a...
7
by: RCS | last post by:
Okay, a rather 'interesting' situation has arisen at a place I work: I need to convert a database from Access to something that can be used over the web. I am currently maintaining and...
6
by: Filips Benoit | last post by:
Hi, A housebuiling firm has now 1 access-DB for the clients witch is used mostly bij remote desktop by only 1 person and it opens exclusively since now only one person is responsebly for...
3
by: Solution Seeker | last post by:
I want to Store the String value with Single Quotes in the Field of Database where if i try to Store the String value with Single Quotes (as it is) then it is throwing the error as SQL String...
37
by: Ian Rastall | last post by:
I've been working on an online books site for almost four years now, and have been putting smart quotes in each book. This is a major hassle, and I'm beginning to think it's not worth it. Is...
4
by: Bob Alston | last post by:
Anyone have experience with converting an access app from Jet database to Mysql? I am specifically looking for any changes I would have to make to my access forms, queries, modules, vba code, etc....
6
by: jfbevilaqua | last post by:
Does anyone know of a utility or a method (VBA or otherwise) to be able to export ALL 100+ MS Access Queries from an Access Table into individual text files perhaps ending with .sql so they can be...
5
by: Hels Bells | last post by:
Hi, I'm looking to do some manipulation on a string containing html code in asp which will involve me either using some regular expressions or just plain old simple replace functionality. The...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.