query in db

ankit

Registered User.
Local time
Tomorrow, 02:45
Joined
Nov 22, 2009
Messages
13
i try to do query 75 % i did but some of doesn't work please if know any one help me. i have this type of number W14-1024-01 this is incorrect number correct number is W14-1024-1. mean i want to take of 0. can't use replace because i have bunch of number like W14-0145-1. if i try to replace -01 to -1 the next correct number also change. please advise.
 
You haven't made your question cystal clear ... but what I think you want to do is replace all instances of -0 with -1 but only at the END of the reference number? i.e. not anywhere else?

You need to write an Update Query which finds records ending "-01" and replaces with "-1"

The key to the query is using the "mid" function to limit the records that get updated to just those that you wish to update

To do this, in your query, you need to utilise criteria as follows:-
mid([referencenumber],9,3) = "-01"
this will pick out the 9th and 10th characters and check whether they are "-01" and enable you to update JUST those records.
 
Thank You very very much for help
 

Users who are viewing this thread

Back
Top Bottom