navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Seach by date

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Seach by date
Page: [1]
 
chadb

 

Posts: 470
From: Kansas
Status: offline

 
Seach by date - 5/6/2008 10:57:29   
Can someone tell me what I am doing wrong. I am trying to search by greater than date.

fp_sQry="SELECT * FROM Item WHERE (TranDate <= 4/15/2008)"

It never returns any records.
BeTheBall

 

Posts: 6271
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Seach by date - 5/6/2008 12:33:39   
Access database? If so, try this:

SELECT * FROM Item WHERE (TranDate <= #4/15/2008#)

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to chadb)
chadb

 

Posts: 470
From: Kansas
Status: offline

 
RE: Seach by date - 5/6/2008 12:57:56   
quote:

(TranDate <= #4/15/2008#)


Yes, that is perfect. One other question, Can I convert a text access field to an int?

I need this to be an int. not char. Is that possible? With the current way, it returns all records.

fp_sQry="SELECT * FROM Item WHERE (Diff < '-5')"

(in reply to BeTheBall)
BeTheBall

 

Posts: 6271
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Seach by date - 5/6/2008 14:04:54   
If Diff is a numeric field then you should NOT surround the value with single quotes. In other words, the SQL should be:

fp_sQry="SELECT * FROM Item WHERE (Diff < -5)"

General rule is as follows:

If the database field is text - Surround the value with single quotes
If the database field is a date - Surround the value with #
Otherwise, use no delimiter

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to chadb)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Seach by date
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts