Connecting to db via win32 (Word or Excel)

2004-05-11 Thread Thomas Nyman
Hi all

I'm a mysql beginner. I have my database up and running and can query it 
via php and apache.

I would like to set things up so that MSExcel and or MSWord can query 
the database and extract info from it. For this reason I downloaded the 
and installed MyODBC-standard-3.51.04-win.exe. No errors where generated 
upon install on my W2K machine. But when I look in Datasources ODBC 
under administrative tools there is no mysql-driver installed.

What am I missing? Is there something else that needs to be installed?

Thanks
Thomas
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


This thing called MOD

2004-05-09 Thread Thomas Nyman
Hi All

I'm a bit perplexed..perhaps its a language thing,,but

the MYSQL reference manual says that

MOD
..Returns the remainder of N divided by M...
and gives an example SELECT MOD(234,10)
 --> 4
This I do not understand. remainder of N divided by M - isn't that 
simply division?

I mean 234 divided by 10 does not equal 4

On my own machine..if I do SELECT MOD(23,6) I would expect 3,8333 as the 
result and not 5.

SInce MOD is returning something other than I expect there must be 
something I am missingin other words...what is MOD returning??

Thomas

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


MySQL query problem in conjunction with PHP

2004-05-08 Thread Thomas Nyman
Hi

I found an instruction on the net concerning "Date Arithmetic" and which 
seems to be exactly what I need to hel me get going..however there seems 
to be either a mistake on my behalf or on the writers behalf.

Can anyone say whats wrong with this query

$query2="UPDATE KK_Fatalie SET datum = DATE_ADD(date,INTERVAL intervall'
''.$typeArray[$row->type].")WHERE kk_ID="".$row->kk_ID"";
The query is suppose to result in the following;

do an UPDATE on table KK_Fatalie and set the column datum equal to 
todays date increased with the interval stated in the column intervall 
where the kolumn kk_ID equals the kk_ID in my earlier php query.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Date calculation and displaying the right date

2004-05-06 Thread Thomas Nyman
Hi All
I've not been able to find a good answer to this or figure out what 
would be the best approach - bear in mind I am a beginner.

I have tried the following
> USE databas
> SELECT Item_A AS 'Something 1',
> Item_B AS 'Something 2',
> Item_C AS 'Something 3',
> INTERVAL 6 MONTH + Item_B AS 'Something 4',
> BEGIN IF CURDATE() >= INTERVAL 6 MONTH + Item_C THEN SELECT INTERVAL 
12 MONTH + Item_C
> [ELSEIF CURDATE() >= INTERVAL 12 MONTH + Item_C THEN SELECT INTERVAL 
18 MONTH + Item_C]
> ELSE INTERVAL 6 MONTH + Item_C)
> END IF
> FROM Table ;

What I want to do is;
I have a post "Item_C" which is a date. Six months after Item_C an event 
occurs (lets call it "The Event") , and continues to occur every six 
months untill the post Item_C recives Status NULL.

I need to be able to extract from the database the following info and I 
will explain it in an example;

Say on May 1 I would like to find out what if any instances of "The 
Event" are occuring during the month of may and the next month. If the 
original Item_C has the date 2003-01-01, the "The Event" has/will occurr 
on 2003-07-01 and on 2004-01-01 and on 2004-07-01 etc. In order for me 
to discover on June 1 2004 that the "The Event" will occur 2004-07-01 I 
need to do a calculation on the original date 2003-01-01 and present the 
relevant date 2004-07-01 at the relevant time and at the same not 
including any Item_C which has status NULL.

I tried to do this with the above example - which I am sure all you 
knowledgeable people can see is kludge at best...I am prepared to figure 
this out on my own but I am having difficulty grasping the appropriate 
methodology here. Hence any and all help will be much appreciated.

Thomas
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]