RE: MI-L Where clause
How do you replace 12 with a variable? Andrew -- Original Message -- From: David Reid [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: MI-L Where clause Date: Tue, 9 Sep 2003 00:30:43 -0500 Andrew, Depending on the column format of the column for [id] Using Query/SQL select from the menu bar, If [id] is a text column: Select Columns * From Table [your table name] Where Condition id like 12 For non-text format (integer, float etc) Select Columns * From Table [your table name] Where Condition id = 12 Hope that helps, David Reid -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2003 11:07 PM To: [EMAIL PROTECTED] Subject: MI-L Where clause Importance: High If I want to select all records where the id equals a set variable how do I format the syntax? ie var_id = 12 select id from table where id = var_id Regards Andrew The information in this e-mail together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this e-mail message is prohibited. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network. - List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 8306 Regards Andrew The information in this e-mail together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this e-mail message is prohibited. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network. - List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 8307
RE: MI-L Where clause
You can do this in several ways. One way is the one you have written yourself Select ID From MYTABLE Where ID = var_id This syntax will work for both char, integer and other types. You can also use the Run Command approach: szCmdStr = Select ID From MYTABLE Where ID = var_id Run Command szCmdStr If your column contains strings you need to add quotations marks around your variable, like this: szCmdStr = Select ID From MYTABLE Where ID = Chr$(34) var_id Chr$(34) Run Command szCmdStr The command string approach is usefull if you have an unknown number of expression to add to your Where statement. Peter Horsbøll Møller GIS Developer Geographical Information IT COWI A/S Rugårdsvej 55 DK-5000 Odense Denmark Tel +45 6313 5013 Direct +45 6313 5008 Mob +45 5156 1045 Fax +45 6313 5090 E-mail [EMAIL PROTECTED] http://www.cowi.dk COWI GIS konference afvikles i dagene d. 2.-3. september. Se yderligere oplysninger på www.cowi.dk/Div04/Profiles/nyheder.asp -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 6:07 AM To: [EMAIL PROTECTED] Subject: MI-L Where clause If I want to select all records where the id equals a set variable how do I format the syntax? ie var_id = 12 select id from table where id = var_id Regards Andrew The information in this e-mail together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this e-mail message is prohibited. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network. - List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 8306 - List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 8308
MI-L Where clause
If I want to select all records where the id equals a set variable how do I format the syntax? ie var_id = 12 select id from table where id = var_id Regards Andrew The information in this e-mail together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this e-mail message is prohibited. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network. - List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 8306