Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

report from visual basic

Posted on 2003-03-21
6
Medium Priority
?
190 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
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
Industry Leaders: 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!

 

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

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.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

572 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