Nazmul Haque 0 Newbie Poster

One slippy mistake that can occur with searching Text and Numeric field is that you have to carefully add the ( ' ) character enclosing the text searching string. For example :
Text search:

SELECT * FROM users_log WHERE user_name='Phillip'

Numeric search:

SELECT * FROM users_log WHERE user_age=>16

In case of Date field search, you have to carefully add the ( # ) character enclosing the date searching string. Say, you have 'visitors_log' table with two fields 'visitor_ID' and 'visit_date'. Now you want to find the total number of visitors who have visited your site within date 7/25/11 to 7/30/11.
The SQL command will be :

SELECT COUNT(visitor_ID) FROM visitors_log WHERE visit_date BETWEEN #7/25/11# AND #7/25/11#
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.