Click here to Skip to main content
15,903,523 members
Home / Discussions / Database
   

Database

 
AnswerRe: sql linq, sum a column in a select new with Pin
chairborne8217-Aug-15 1:46
chairborne8217-Aug-15 1:46 
GeneralRe: sql linq, sum a column in a select new with Pin
Mycroft Holmes17-Aug-15 2:42
professionalMycroft Holmes17-Aug-15 2:42 
AnswerRe: sql linq, sum a column in a select new with Pin
Jörgen Andersson17-Aug-15 3:01
professionalJörgen Andersson17-Aug-15 3:01 
GeneralRe: sql linq, sum a column in a select new with - Got the Sum part to work, need the Joins Pin
jkirkerx17-Aug-15 5:19
professionaljkirkerx17-Aug-15 5:19 
QuestionWPF/Entity Framework Design Time Exception Pin
Kevin Marois14-Aug-15 5:49
professionalKevin Marois14-Aug-15 5:49 
AnswerRe: WPF/Entity Framework Design Time Exception Pin
Jörgen Andersson15-Aug-15 6:51
professionalJörgen Andersson15-Aug-15 6:51 
QuestionDatabase Connectivity Problem Pin
Member 1190668913-Aug-15 1:20
Member 1190668913-Aug-15 1:20 
AnswerRe: Database Connectivity Problem Pin
Mycroft Holmes13-Aug-15 16:20
professionalMycroft Holmes13-Aug-15 16:20 
AnswerRe: Database Connectivity Problem Pin
Corporal Agarn14-Aug-15 0:40
professionalCorporal Agarn14-Aug-15 0:40 
QuestionUsing SQLite in C++ and C# Pin
Kevin Marois7-Aug-15 12:47
professionalKevin Marois7-Aug-15 12:47 
AnswerRe: Using SQLite in C++ and C# Pin
PIEBALDconsult7-Aug-15 14:04
mvePIEBALDconsult7-Aug-15 14:04 
QuestionSQL Transacation questions Pin
Tunisiano326-Aug-15 1:57
Tunisiano326-Aug-15 1:57 
AnswerRe: SQL Transacation questions Pin
Eddy Vluggen16-Aug-15 1:17
professionalEddy Vluggen16-Aug-15 1:17 
GeneralRe: SQL Transacation questions Pin
chairborne8217-Aug-15 17:12
chairborne8217-Aug-15 17:12 
QuestionSQL Linq, Row Number() Over, equiv in VB Pin
jkirkerx4-Aug-15 14:03
professionaljkirkerx4-Aug-15 14:03 
AnswerRe: SQL Linq, Row Number() Over, equiv in VB Pin
Richard Deeming5-Aug-15 1:41
mveRichard Deeming5-Aug-15 1:41 
GeneralRe: SQL Linq, Row Number() Over, equiv in VB Pin
jkirkerx5-Aug-15 6:09
professionaljkirkerx5-Aug-15 6:09 
GeneralRe: SQL Linq, Row Number() Over, equiv in VB Pin
jkirkerx5-Aug-15 7:58
professionaljkirkerx5-Aug-15 7:58 
GeneralRe: SQL Linq, Row Number() Over, equiv in VB Pin
Richard Deeming5-Aug-15 8:12
mveRichard Deeming5-Aug-15 8:12 
GeneralRe: SQL Linq, Row Number() Over, equiv in VB Pin
Richard Deeming5-Aug-15 8:18
mveRichard Deeming5-Aug-15 8:18 
GeneralRe: SQL Linq, Row Number() Over, equiv in VB Pin
jkirkerx5-Aug-15 10:39
professionaljkirkerx5-Aug-15 10:39 
QuestionIs this possible, using an old foxpro database files and oledb for DBase Pin
jkirkerx30-Jul-15 13:18
professionaljkirkerx30-Jul-15 13:18 
I have this report for sales rep margin in Account Mate for DOS, that uses FoxPro for database table file, .dbx

The item tables or DB files does not have a column for sales rep and order dates, so I can't go to the table directly to get my data.

So without knowing or even where to start to write this in pure SQL, I wrote 2 functions

1.
Get Invoices that match the sales rep and start and stop dates, and store it in a List(of invoices)
2. loop a function that targets items by invoice number, and get the cost, price, qty, etc.

When you have 500 invoices, it takes forever to run, slowing down fixing my other problems, which may be fixed now.

Do you think it's possible to merge these statements into a single statement. Plus if so, a nudge in the right direction. I hate this old Fox Pro stuff, it was before my time.
SELECT 
  h.FINVNO 
, h.FSHIPDATE 
 FROM ARINV01H.dbf h 
 WHERE 
 h.FSALESPN = @FSALESPN 
 AND 
 h.FSHIPDATE >= @startDate AND h.FSHIPDATE <= @stopDate 
UNION ALL 
SELECT 
  v.FINVNO 
, v.FSHIPDATE 
 FROM ARINV01.dbf v 
 WHERE 
 v.FSALESPN = @FSALESPN 
 AND 
 v.FSHIPDATE >= @startDate AND v.FSHIPDATE <= @stopDate 
SELECT
 DISTINCT FITEMNO
, SUM(FSHIPQTY)
, SUM(FCOST * FSHIPQTY)
, SUM(FPRICE * FSHIPQTY)
, (SELECT FDESCRIPT FROM ICITM01.dbf i WHERE i.FITEMNO = h.FITEMNO) AS FREALDESC
 FROM
(
   SELECT
      h.FITEMNO
    , h.FSHIPQTY
    , h.FCOST
    , h.FPRICE
   FROM ARTRS01H.dbf h
   WHERE
   h.FINVNO = @FINVNO
   UNION
   SELECT
      v.FITEMNO
    , v.FSHIPQTY
    , v.FCOST
    , v.FPRICE
   FROM ARTRS01.dbf v
   WHERE
   v.FINVNO = @FINVNO
)
 GROUP BY FITEMNO "

AnswerRe: Is this possible, using an old foxpro database files and oledb for DBase Pin
Mycroft Holmes30-Jul-15 14:13
professionalMycroft Holmes30-Jul-15 14:13 
GeneralRe: Is this possible, using an old foxpro database files and oledb for DBase Pin
jkirkerx31-Jul-15 6:25
professionaljkirkerx31-Jul-15 6:25 
Questionrestore database Pin
millerwilliam3529-Jul-15 2:51
millerwilliam3529-Jul-15 2:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.