NeoSoft Support Forum Forum Index  Your source for Plug-Ins, sample publications, source code and more...

Source Language:
Translate to:

NeoSoft Support Forum
NeoSoft Community Support Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   SmartFeedSmartFeed   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Setting a field for a selection of records

 
Post new topic   printer-friendly view   Reply to topic    NeoSoft Support Forum Forum Index -> NeoBookDBPro
View previous topic :: View next topic  
Author Message
andybrock
NeoBooker


Joined: 20 Apr 2009
Posts: 30

PostPosted: Fri Jun 12, 2009 6:28 am    Post subject: Setting a field for a selection of records Reply with quote

I have a database of products and there are a series of status flags which are boolean fields for if the product is discontinued, etc.

If I perform a query so that the current view is of a set of products that match a criteria is there an easy way to set the status flag to true for all currently queried records or do I have to loop through each one and change the flag?

Andy
Back to top
View user's profile Send private message
Wrangler
NeoBooker


Joined: 31 Mar 2005
Posts: 1331
Location: USA

PostPosted: Fri Jun 12, 2009 7:19 am    Post subject: Reply with quote

First do your query, then do dbpstrReplace. Then showall to view all records again.
_________________
Wrangler
--------------
Before you criticize someone, walk a mile in their shoes. Then when you criticize them you're a mile away and you have their shoes. Surprised - Wrangler

Software made with NeoBook
http://highdesertsoftware.com
Back to top
View user's profile Send private message Visit poster's website
carlos torres
NeoBooker


Joined: 02 May 2005
Posts: 223
Location: Pamplona, Colombia

PostPosted: Sat Jun 13, 2009 9:16 pm    Post subject: about setting a field Reply with quote

Dear Andybrock
I agree with Wrangler do the query first and after that you can exert an sql statement in order tu update an specific field.


Code:
If "[AnyCondition]" "<>" ""
         dbpExecSQL "DBAlias" "UPDATE MyTableName SET MyField =[#39][MyNewValue][#39] |WHERE FieldOne=[#34][Value][#34] AND Field2=[#34][OtherValue][#34] AND STATUS=TRUE" ""
   EndIf
EndIf


I hope it will help you
regards

carlost
Back to top
View user's profile Send private message
Wrangler
NeoBooker


Joined: 31 Mar 2005
Posts: 1331
Location: USA

PostPosted: Sat Jun 13, 2009 9:22 pm    Post subject: Reply with quote

Carlos: One too many "endif"s. Or, not enought "if"s. However you look at it. Smile
_________________
Wrangler
--------------
Before you criticize someone, walk a mile in their shoes. Then when you criticize them you're a mile away and you have their shoes. Surprised - Wrangler

Software made with NeoBook
http://highdesertsoftware.com
Back to top
View user's profile Send private message Visit poster's website
andybrock
NeoBooker


Joined: 20 Apr 2009
Posts: 30

PostPosted: Mon Jun 15, 2009 9:15 am    Post subject: Reply with quote

Thanks for your replies. I didn't realise you could search/replace a boolean field. Still used to far more restrictive programming languages.

Andy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    NeoSoft Support Forum Forum Index -> NeoBookDBPro All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Forum content © 2008 NeoSoft Corp. All rights reserved.