Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2007, 11:15 AM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default please help vb access date pblm

hi all
 im using the following querry for crystal report
rr.SQLQuery = "select * from Table where Format(DateField , 'yyyy/mm/dd' ) >= format ( '" & fromdt & "','yyyy/mm/dd' ) and Format(DateField ,'yyyy/mm/dd') <= format ( '" & todt & "','yyyy/mm/dd' )"

my datefield in database is text type

The pblm is , while selecting the date ranges like 2007/01/31 to 2007/02/01 im not getting the report details for some other ranges
im getting results , tried a few things but didnt clicked

Please help
Renjith

 
Old February 6th, 2007, 11:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

and you have data for that date range?? you are only showing the records with date 2007/02/01 with that query..

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old February 6th, 2007, 11:39 AM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HI

  Im letting the user to select a date range

Thanks
renjith

 
Old February 6th, 2007, 11:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

ok.. that's ok... but the query is failing??? do you have data to show for that specific query??

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old February 6th, 2007, 11:46 AM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes offcourse im getting the result if i select the rang 2007/01/31 to 2007/02/06

 
Old February 6th, 2007, 11:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

I 'm not following you.. can you explain better where is your problem then???

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old February 6th, 2007, 11:19 PM
Registered User
 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you should make date from ur text field by using date, left, right and mid (text related) functions.

first of all separate the day month and year from text field and than use date function to make it as date

you can use date format of YYYYMMDD format. it is easy to compare range of date by using this format..

regards
bhavesh

Nothing
 
Old February 7th, 2007, 01:18 AM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi Gonzalo
  my database has enough records , date field in table is of text type , while im generating
report using date range some range gives me exact result but some not like above said ranges

Thanks
renjith



 
Old February 7th, 2007, 01:19 AM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi bhavesh
   can u give me some example code
Thanks
Renjith

 
Old February 7th, 2007, 03:44 AM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi bhavesh
  thnks using reply i sorted the pblm
thnks very much
Renjith






Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.Net - Access DB - Date compare johneecc VB How-To 4 August 7th, 2008 04:23 PM
compacting database pblm MathLearner VB Databases Basics 8 September 27th, 2007 07:34 AM
How to Access Ms-Access WorkGroup tables using VB kishoremf BOOK: Professional Crystal Reports for VS.NET 1 April 29th, 2007 02:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.