Paul,
I created my own SQL Server database, so none of the columns have “dbo” in front of them SQL Server Table Name - dbo.Tablename I would sattach it as dbo.Tablename another sattach as alias dboTablename When all I want to do is get a count or get a distinct column would do this SELECT DISTINCT(columnName) FROM dboTablename When doing an INSERT from R:Base to SQL Server Table I would INSERT INTO `dbo.Tablename` (columnList) SELECT columnList FROM R:BaseTable I’m also connecting to the SQL Server database using the DSNless string and not the ODBC connection. Buddy From: rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com] On Behalf Of Paul C. Buckley Sent: Thursday, August 3, 2017 2:13 PM To: rbase-l@googlegroups.com Subject: RE: [RBASE-L] - Problem with a Select Distinct Statement Buddy, Bill’s suggestion of using the column number worked but if you could give me an example of what you are using that works that would be great too. Thanks, Paul From: rbase-l@googlegroups.com <mailto:rbase-l@googlegroups.com> [mailto:rbase-l@googlegroups.com] On Behalf Of Buddy Walker Sent: August 03, 2017 1:50 PM To: rbase-l@googlegroups.com <mailto:rbase-l@googlegroups.com> Subject: RE: [RBASE-L] - Problem with a Select Distinct Statement You can alias the table when you sattach especially if you’re not updating the table. When updating or adding records I had to have the ‘dbo’ so all I did was put IDQUOTES around the table name. Buddy From: karentellef via RBASE-L [mailto:rbase-l@googlegroups.com] Sent: Thursday, August 3, 2017 11:59 AM To: rbase-l@googlegroups.com <mailto:rbase-l@googlegroups.com> Subject: Re: [RBASE-L] - Problem with a Select Distinct Statement Is the "dbo" required? I'm starting a project connecting to SQL Server, and we're not doing that Karen -----Original Message----- From: Paul C. Buckley <p...@buckleyandassoc.com <mailto:p...@buckleyandassoc.com> > To: rbase-l <rbase-l@googlegroups.com <mailto:rbase-l@googlegroups.com> > Sent: Thu, Aug 3, 2017 10:55 am Subject: RE: [RBASE-L] - Problem with a Select Distinct Statement Buddy, That didn’t work either, I still get the “Database dbo not connected” error. Paul From: rbase- <mailto:l...@googlegroups.com> l...@googlegroups.com [ <mailto:rbase-l@googlegroups.com?> mailto:rbase-l@googlegroups.com] On Behalf Of Buddy Walker Sent: August 03, 2017 11:05 AM To: rbase- <mailto:l...@googlegroups.com> l...@googlegroups.com Subject: RE: [RBASE-L] - Problem with a Select Distinct Statement Paul Since there is a dot in the column name try using the IDQUOTES around the column name Buddy From: <mailto:rbase-l@googlegroups.com> rbase-l@googlegroups.com [ <mailto:rbase-l@googlegroups.com> mailto:rbase-l@googlegroups.com] On Behalf Of Paul C. Buckley Sent: Thursday, August 3, 2017 10:41 AM To: <mailto:rbase-l@googlegroups.com> rbase-l@googlegroups.com Subject: [RBASE-L] - Problem with a Select Distinct Statement Good morning, I'm running the latest build of R:BASE X Enterprise. I have a connection to a SQL database & about 6 or 8 SQL tables attached. I'm trying to create a SQL Select Distinct statement and can't get the syntax correct. Here's what I've tried: SELECT DISTINCT dbo.sales_rep.id AS rep_id, sales_rep.NAME-ALIAS from dbo.SALES_REP Error is: SELECT DISTINCT sales_rep.id AS rep_id from dbo.SALES_REP Error is: But this works without error: SELECT * from dbo.SALES_REP Any blues clues? Thanks, Paul Buckley -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to <mailto:rbase-l+unsubscr...@googlegroups.com> rbase-l+unsubscr...@googlegroups.com. For more options, visit <https://groups.google.com/d/optout> https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to <mailto:rbase-l+unsubscr...@googlegroups.com> rbase-l+unsubscr...@googlegroups.com. For more options, visit <https://groups.google.com/d/optout> https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to <mailto:rbase-l+unsubscr...@googlegroups.com> rbase-l+unsubscr...@googlegroups.com. For more options, visit <https://groups.google.com/d/optout> https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to rbase-l+unsubscr...@googlegroups.com <mailto:rbase-l+unsubscr...@googlegroups.com> . For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to rbase-l+unsubscr...@googlegroups.com <mailto:rbase-l+unsubscr...@googlegroups.com> . For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to rbase-l+unsubscr...@googlegroups.com <mailto:rbase-l+unsubscr...@googlegroups.com> . For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to rbase-l+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.