Subquery and LIMIT

2004-05-19 Thread Jacque Scott
I have a subquery where I am retrieving Shipment information from the DB. I want to LIMIT the result to '1' but I first need the results in 'ID' order. When I use this subquery I don't get the FIRST row because the data is not in ID order: (SELECT TextValue FROM tblQuoteItems WHERE (Type =

Sorting with an alpha numeric field.

2004-03-23 Thread Jacque Scott
I need to create a query that will sort by a alpha numeric field. I need the ID field returned and one problem that I will face is that when it sorts in alpha numeric the ID field will be out of sequence. I will use this ID field in another part of the program so I need to make sure I get all of

Re: Sorting with an alpha numeric field.

2004-03-23 Thread Jacque Scott
I have something like A001C, B689, B1001 etc... Dan Nelson [EMAIL PROTECTED] 3/23/2004 10:07:43 AM In the last episode (Mar 23), Jacque Scott said: I need to create a query that will sort by a alpha numeric field. I need the ID field returned and one problem that I will face is that when

Re: Sorting with an alpha numeric field.

2004-03-23 Thread Jacque Scott
I will give that a try. Thank you Dan Nelson [EMAIL PROTECTED] 3/23/2004 11:31:50 AM In the last episode (Mar 23), Jacque Scott said: I have something like A001C, B689, B1001 etc... Aah. This question pops up about once a year, usually under the subject of Natural Sorting. There's

Mysterious 'x' when retrieving records

2004-03-11 Thread Jacque Scott
I have a very simple query SELECT ProblemReports.* FROM ProbelmReports; If there is no data in the column 'Description' it returns 'x'. There is no default value being used and there is no data in the field. Why would it return 'x'? The field type is 'TEXT'. I have another 'TEXT' field in

RE: Mysterious 'x' when retrieving records

2004-03-11 Thread Jacque Scott
some sample data and ddl? -Original Message- From: Jacque Scott To: [EMAIL PROTECTED] Sent: 3/11/04 3:12 PM Subject: Mysterious 'x' when retrieving records I have a very simple query SELECT ProblemReports.* FROM ProbelmReports; If there is no data in the column 'Description

INSERT INTO SELECT

2004-03-04 Thread Jacque Scott
Table ProductSums has not been created. Can you create this table when you insert data into it? INSERT INTO ProductSums SELECT DISTINCTROW IndenturedList.NSIPartNumber, Sum(tblInvTransaction.Qty) AS SumOfQty FROM IndenturedList;

Re: INSERT INTO SELECT

2004-03-04 Thread Jacque Scott
OK, I found the answer. CREATE TABLE ProductSums SELECT DISTINCTROW IndenturedList.NSIPartNumber, Sum(tblInvTransaction.Qty) AS SumOfQty FROM IndenturedList;

CREATE TEMPORARY TABLE

2004-03-03 Thread Jacque Scott
I am trying to create a temporary table through code in my DB. I can do it when I use MySQL Control Center or something like that, but when I try to do it through my VB program it doesn't work. Here is the sql string: CREATE TEMPORARY TABLE IndenturedList (Level_1 TEXT, Level_2 TEXT,

Re: CREATE TEMPORARY TABLE

2004-03-03 Thread Jacque Scott
In my original post I didn't add that I close the connection just before I exit the function. If lngRecordAffected 0 Then ' if the execute was successful then let's commit the updates cn.CommitTrans WriteData = lngRecordAffected Else ' otherwise let's rollback to before

MySQL SELECT problem

2004-03-03 Thread Jacque Scott
Try something like this: SELECT ID, Name, Country FROM peoplelist GROUP BY Country HAVING count(Country)10; That might work. Also you can have subselects in 4.0.

Re: MySQL SELECT problem

2004-03-03 Thread Jacque Scott
You are correct. Sorry about that. charles kline [EMAIL PROTECTED] 3/3/2004 2:46:51 PM sub selects are only in 4.1 I thought? On Mar 3, 2004, at 5:08 PM, Jacque Scott wrote: Also you can have subselects in 4.0.

Re: Import Access DB into MySQL

2004-02-26 Thread Jacque Scott
from my access db to MySQL. Karam --- Jacque Scott [EMAIL PROTECTED] wrote: I have a .mdb file which I need to import into MySQL. This needs to be done behind the scenes and with code. Can I use LOAD DATA INFILE where I use the .mdb file instead of a .txt file? If not does anyone have any

Import Access DB into MySQL

2004-02-26 Thread Jacque Scott
I have a .mdb file which I need to import into MySQL. This needs to be done behind the scenes and with code. Can I use LOAD DATA INFILE where I use the .mdb file instead of a .txt file? If not does anyone have any suggestions? Thanks, Jacque

Count()

2004-02-25 Thread Jacque Scott
My program, NCR (Non-Conformity Report), keeps track of problems with items that are received from vendors. I am creating a report where the user can retrieve a list of vendors that have had a NCR written against them a certain number of times. For example, if the user wants to see what vendors

Re: Count()

2004-02-25 Thread Jacque Scott
That works. I knew I was missing something simple. It was the GROUP BY and the HAVING together. Thank you very much. Michael Stassen [EMAIL PROTECTED] 2/25/2004 9:05:34 AM Jacque Scott wrote: My program, NCR (Non-Conformity Report), keeps track of problems with items that are received

Updating a Record

2004-02-24 Thread Jacque Scott
I am converting from Access 2.0 to MySQL and I am going through all of my code to make it compatible with MySQL. I was testing my Update for one of my queries and I don't know if I found a bug or if MySQL was designed to do this. In my program I pass an UPDATE string to MySQL. There can be

Date_Format

2004-02-20 Thread Jacque Scott
I have the following query where the user will put in a date. They will put it in like '01/01/04'. I use this date in my WHERE clause but MySQL needs the date like '2004/01/01'. I tried using Date_Format('04/01/01', '%Y-%m-%d') to change the way it is formatted but I don't get the correct data

Crosstab queries?

2004-02-19 Thread Jacque Scott
I have a query where I want to display the column headings as row headings. Here is my query: Code:SELECT DISTINCTROW Avg(DateDiff(OrderDate, POItem.ReceivedDate)) AS AvgLeadTime, Min(DateDiff(Po.OrderDate, POItem.ReceivedDate)) AS MinLeadTime, Max(DateDiff(Po.OrderDate, POItem.ReceivedDate))

DateTime NOW()

2004-02-10 Thread Jacque Scott
I have a DateTime data type for one of my fields. If an entry is being INSERTed then I want the DateTime to be NOW(). I want this done automatically and not have to set me SQL str to do this. I have tried to set the default as NOW() but it will insert -00-00 ... I don't want this, I want

DateTime NOW()

2004-02-10 Thread Jacque Scott
I have a DateTime data type for one of my fields. If an entry is being INSERTed then I want the DateTime to be NOW(). I want this done automatically and not have to set me SQL str to do this. I have tried to set the default as NOW() but it will insert -00-00 ... I don't want this, I want

More Left Join problems

2004-01-29 Thread Jacque Scott
I had posted a message earlier this week about my 'Left Join' taking too long to run. This seems to be happening on all of my queries that have a 'Left Join'. Does anyone have any suggestions on why this would happen? Here is one query which took 45.72 sec to run: SELECT

Re: More Left Join problems

2004-01-29 Thread Jacque Scott
to decipher the question--I'd assume that other people do the same. HTH Bill Date: Thu, 29 Jan 2004 08:03:25 -0800 From: Jacque Scott [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: More Left Join problems I had posted a message earlier this week about my 'Left Join' taking too long

Re: More Left Join problems

2004-01-29 Thread Jacque Scott
the result based on group functions such as max() or count()--then, the values you are testing aren't available for the where clause to use. - Original Message - From: Jacque Scott To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] Sent: Thursday, January 29, 2004 2:18 PM Subject: Re: More Left Join

Using Wildcards in Query

2004-01-27 Thread Jacque Scott
I am converting over to mySQL from Access 2.0 and I am having a little trouble with a query. Here it is: SELECT Max(WBS) AS LastOfWBS FROM Projects Where((WBS)) Like txtEntryData(0).Text #%; I am trying to get the last WBS ID starting with a particular letter the user will type in the

Re: Using Wildcards in Query

2004-01-27 Thread Jacque Scott
://www.mysql.com/doc/en/Pattern_matching.html Note that in MySQL, the wildcard characters are _ and %, where _ represents a single character and % represents any number of characters, unlike Access, where if I remember, # means one char and * means any number of characters (?) Good luck! For Jacque Scott

Left Join takes too long

2004-01-26 Thread Jacque Scott
I have a fairly simple query where I feel it takes too long to run. SELECT Products.NSIPartNumber,Products.Cost, Products.ModelNo, Products.USPrice, Products.VendorPart, Products.Description , Products.ProductID, Sum(tblInvTransaction.Qty) AS SumOfQty FROM Products LEFT JOIN tblInvTransaction ON

Re: Left Join takes too long

2004-01-26 Thread Jacque Scott
In Access 2.0 and mySQL Products.ProductID is indexed but tblInvTransaction.ProductID is not. I tried to set tblInvTransaction.ProductID as indexed but it still took a long time. Daniel Kasak [EMAIL PROTECTED] 1/26/2004 12:18:46 PM Jacque Scott wrote: I have a fairly simple query where I

Re: Left Join takes too long

2004-01-26 Thread Jacque Scott
. On Jan 26, 2004, at 1:35 PM, Jacque Scott wrote: I have a fairly simple query where I feel it takes too long to run. SELECT Products.NSIPartNumber,Products.Cost, Products.ModelNo, Products.USPrice, Products.VendorPart, Products.Description , Products.ProductID, Sum(tblInvTransaction.Qty

Re: Left Join takes too long

2004-01-26 Thread Jacque Scott
database is not a comparable setup. On Jan 26, 2004, at 1:35 PM, Jacque Scott wrote: I have a fairly simple query where I feel it takes too long to run. SELECT Products.NSIPartNumber,Products.Cost, Products.ModelNo, Products.USPrice, Products.VendorPart, Products.Description