473,320 Members | 2,189 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Simple function for returning a character based on search criteria..

Hi,

how do I do a simple formula, which will search a field for special
characters and return a value.

If it finds "%" - it returns 1
else
If it finds "?" it returns 2

end

If this is the incorrect newsgroups, please direct me to the correct one

regards Jorgen

Feb 20 '07 #1
2 1365
Ah.. this one is actually a bit more complex.

My problem is that in a amount field I have both % and Quantity mixed
together. So the formula should check the "format" column for the amount
field, if the format columns contains "%" it return the value - if not, i
writes zero in my expression.

Logical ?

Regards
Jorgen
"Jorgen [DK/2600]" <ny******************@gmail.comwrote in message
news:45***********************@news.sunsite.dk...
Hi,

how do I do a simple formula, which will search a field for special
characters and return a value.

If it finds "%" - it returns 1
else
If it finds "?" it returns 2

end

If this is the incorrect newsgroups, please direct me to the correct one

regards Jorgen

Feb 20 '07 #2
Jorgen [DK/2600] (ny******************@gmail.com) writes:
Ah.. this one is actually a bit more complex.

My problem is that in a amount field I have both % and Quantity mixed
together. So the formula should check the "format" column for the amount
field, if the format columns contains "%" it return the value - if not, i
writes zero in my expression.
SELECT CASE format WHEN '%' THEN amount ELSE 0 END

I don't know if this fits your bill. But if it does not, please post:

o CREATE TABLE statement for your table(s)
o INSERT statements with sample data.
o The desired result given the sample.

This helps to clarify what you are looking for, and makes it easy to copy
and paste to develop a tested solution.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 20 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Haines Brown | last post by:
Re. <title>, my impression has been that a line break is _NOT_ allowed in the contained text. Is that true? Also, I gather a double quotation mark in the text string (and ampersand, etc.) _IS_...
4
by: i. dzhugashvili | last post by:
I'm hoping someone can help me here. I'm having problems using a function to get the search criteria for a column in the QBE grid. The column's data type is Long and the problem is that if I...
4
by: James | last post by:
Dear group, Can anyone tell me how to do the following? I have a basic list of numbers in a table I want to be able to search these by letting the user type "<10" or ">=50" on a simple form...
3
by: Bob C. | last post by:
When I migrated my tables to SQL Server I needed a way to overcome the slow performance of the Find method on my recordsets. Although this can be done by accessing the table directly using dao and...
51
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
9
by: cmk128 | last post by:
Hi Why put * in front of the function name in the declaration? int (*write)(struct inode *, struct file *, const char *, int); thanks from Peter (cmk128@hotmail.com)
3
by: Russell | last post by:
Hey, ok i have numerous tables to search through for a 'site search'. some of the searchble fields have html embeded within so after some quick referencing, saw I can use the regExp function...
5
by: SeanCly10 | last post by:
Hi all. I don't want to sound like a complete idiot here, but I'm somewhat limited in my coding knowledge, and I need some advice and help. I'm working on a database that will eventually be used...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.