Update Query (1 Viewer)

ielamrani

Registered User.
Local time
Today, 08:02
Joined
May 6, 2008
Messages
51
Hi,
Can anyone tell me why this is not updating the table?

UPDATE FMPSL SET MODE_PREM = ([2010]/12)
WHERE (((DatePart("m",(DateAdd("m",1,Date()))))=DatePart("m",[FMPSL].[REG_DATE])) AND (([MODE])="M"));
Thanks.
 

boblarson

Smeghead
Local time
Today, 05:02
Joined
Jan 12, 2001
Messages
32,059
First up -

What datatype is MODE_PREM?

If text and you want the actual thing in brackets [2010]/12 like that then you would nee quotes:

"[2010]/12"
 

ielamrani

Registered User.
Local time
Today, 08:02
Joined
May 6, 2008
Messages
51
Thanks for the quick reply.
It's not a text it a number.
 

boblarson

Smeghead
Local time
Today, 05:02
Joined
Jan 12, 2001
Messages
32,059
So you are wanting the value of

2010/12

inserted which equals 167.5 (so 167.5 inserted?)

If not then what is it you really want from that number? You can't put brackets around part of it as it then does not become a number. You can't have the / slash because it is not a number but is an operator.
 

ielamrani

Registered User.
Local time
Today, 08:02
Joined
May 6, 2008
Messages
51
This sounds confusing but 2010 is a name of a column that contains a number. The formula is trying to divide the number in 2010 column by 12.

I did not create this I was only asked to fix it.
 

Users who are viewing this thread

Top Bottom