?
Solved

report from visual basic

Posted on 2003-03-21
6
Medium Priority
?
187 Views
Last Modified: 2013-11-25
This might be easy for you experts.
I need to create a Report from visual basic Between ?  and ? (Where ? is date)
But, In Table, datatype for this date is not date, Its text and i can not change datatype for this date field since that table is using by some other programs.

can anyone help me on this?
0
Comment
Question by:babids
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 2

Expert Comment

by:saurabhgupta
ID: 8184591
Hi babids,
You can use the Cdate function to convert the text to date.


Regards
Saurabh
0
 

Expert Comment

by:tat83
ID: 8185478
or another alternative way use format function
like this
format(urdate,"dd/mm/yyyy")
hope it help u
0
 
LVL 1

Accepted Solution

by:
Xadine earned 160 total points
ID: 8186058
If the date is stored in text in the format yyyy-mm-dd, then the date range still works. Converting the date before you check it is okay but it won't use any indexes on the column so the query runs slower.

If the date ranges are not too far apart, you can write the query differently...e.g.,

either explicitly 'where date in ('date1', 'date2', 'date3', etc)'

or else insert the list of dates into a separate table and do a joined query on that table
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:babids
ID: 8188136
i use CDate function too but since its datatype is not date i didnt get anything on report, i mean report is blank.
0
 

Expert Comment

by:tat83
ID: 8193229
i am not sure can this work or not
when u deal with date
u need to put "#" rather than "'"
0
 
LVL 1

Expert Comment

by:Xadine
ID: 8193912
What format are your text dates stored in the table? Is it dd/mm/yyyy? Are there any invalid dates or all valid?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question