CodeConnect.Net Beta


   Explore    Entry   Register  Login  
windowsxp-general
access
windows-vista-mail
windows-vista-general
windowsupdate
windowsmedia-player
access-forms
windows-live-mail-desktop
windowsxp-help_and_support
access-queries
access-modulesdaovba
access-formscoding
windows-server-sbs
windows-server-general
access-reports
windows-vista-music_pictures_video
windowsce-platbuilder
windows-live-messenger
windows-terminal_services
windows-powershell
windows-server-active_directory
access-gettingstarted
windows-mediacenter
windowsxp-hardware
windowsxp-network_web
windows-64bit-general
windows-live-sync
windows-vista-hardware_devices
windows-inetexplorer-ie6_outlookexpress
windows-group_policy
windows-server-networking
windows-vista-installation_setup
windows-vista-networking_sharing
windowsxp-basics
access-tablesdbdesign
windowsxp-perform_maintain
windows-vista-performance_maintenance
windows-networking-wireless
windows-vista-file_management
windows-inetexplorer-ie6-browser
windows-server-dns
windows-server-update_services
windows-vista-security
windows-vista-administration_accounts_passwords
windows-vista-games
windows-file_system
access-activexcontrol
windows-live-foldershare
windows-live-photogallery
access-developers-toolkitode
access-conversion




Can Reply:  Yes Members Can Edit: No Online: Yes
Zone: > Microsoft News > microsoft.public.access.queries Tags:
Item Type: Date Entered: 11/10/2009 8:08:34 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 2 Views: 294 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
"Benjamins via
NewsGroup User
Data type mismatch in criteria expression issue11/10/2009 8:08:34 AM
Reply

0

Hi,

I have a query call ListRecur where it will Caculate the date when the entry
is going to recur

Below it the query Field information
DetId (FieldName same as table, Long Integer)
DetDate (FieldName same as table, Date/Time)
RecurDate (A expression Where it will add the DetDate base on user selection
of recur period) Formula: DateAdd([DetRecurType],[DetRecurPeriod],[DetDate])

[DetRecurType] ia a string containing either 1 of the following the following
: 'd', 'ww','m','yyyy'
[DetRecurPeriod] is an integer

This query works fine and the RecurDate can be caculate correctly.

Later i try to add the criteria to RecurDate so that it will filter out any
records that
is < Now() which i have been using for the rest of the other queries.
It give me an error saying that Data type mismatch in criteria expression

Is there any thing that i have done wrong that the system does not recongise
that the RecurDate is not a date format.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200911/1

John Spencer <s
NewsGroup User
Re: Data type mismatch in criteria expression issue11/10/2009 2:23:43 PM
Reply

0

Well, you will have a problem if you have a null value in any record in the
field DetRecurType or in the field DetRecurPeriod. So you might want to test
for that. Also, if DetRecurType is not one of the valid arguments, you will
get an error.

As a guess you have a data problem somewhere. You can probably handle the
problem by using something like the following to do the calculation:

IIF(IsNumeric(DetRecurPeriod) and DetRecurType IN ("d","ww","m","yyyy"),
DateAdd([DetRecurType],[DetRecurPeriod],[DetDate]),Null)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Benjamins via AccessMonster.com wrote:
> Hi,
>
> I have a query call ListRecur where it will Caculate the date when the entry
> is going to recur
>
> Below it the query Field information
> DetId (FieldName same as table, Long Integer)
> DetDate (FieldName same as table, Date/Time)
> RecurDate (A expression Where it will add the DetDate base on user selection
> of recur period) Formula: DateAdd([DetRecurType],[DetRecurPeriod],[DetDate])
>
> [DetRecurType] ia a string containing either 1 of the following the following
> : 'd', 'ww','m','yyyy'
> [DetRecurPeriod] is an integer
>
> This query works fine and the RecurDate can be caculate correctly.
>
> Later i try to add the criteria to RecurDate so that it will filter out any
> records that
> is < Now() which i have been using for the rest of the other queries.
> It give me an error saying that Data type mismatch in criteria expression
>
> Is there any thing that i have done wrong that the system does not recongise
> that the RecurDate is not a date format.
>
"Benjamins via
NewsGroup User
Re: Data type mismatch in criteria expression issue11/11/2009 2:02:55 AM
Reply

0

Thanks for your info. I will give it a try.

John Spencer wrote:
>Well, you will have a problem if you have a null value in any record in the
>field DetRecurType or in the field DetRecurPeriod. So you might want to test
>for that. Also, if DetRecurType is not one of the valid arguments, you will
>get an error.
>
>As a guess you have a data problem somewhere. You can probably handle the
>problem by using something like the following to do the calculation:
>
>IIF(IsNumeric(DetRecurPeriod) and DetRecurType IN ("d","ww","m","yyyy"),
>DateAdd([DetRecurType],[DetRecurPeriod],[DetDate]),Null)
>
>John Spencer
>Access MVP 2002-2005, 2007-2009
>The Hilltop Institute
>University of Maryland Baltimore County
>
>> Hi,
>>
>[quoted text clipped - 20 lines]
>> Is there any thing that i have done wrong that the system does not recongise
>> that the RecurDate is not a date format.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200911/1

3 Items, 1 Pages 1 |< << Go >> >|







Similar:

quirky query

calculation in a query

recordsetnot updateable

where do i get a windows installer download from

dsum problem

dsum problems

appendding to/from upsize_ts (time stamp) field

expression for criteria for form with combo boxes

crosstab with conditional sum()

query prompt for one or all months in database

multiple iif in query

calculate start and end date of a quarter

store employee id in table, display user name in form

query to pull between two dates

calculate interest amount based on average daily balance

unique count

query that sum two tables

remove all characters after "hyphen" in field

combine queries

iif statement with dcount crashes a2007

error in syntax

autofill fields

ms access

query for multiple due dates

help me

pie chart

cross tab query label change

append changed data into a history table

find exact match or match those only few cents off

auto join in access 2007

how to get various purchased amount made by persons

letter in reports

calculating hours on a timeclock form

iif statement and multiple items

2 weeks prior

zero fill field

crosstab query question

query-finding umatched data with duplicates

filtering records for 2 types of dates

update and append queries

new page

between date with greater than or eaqual to

append query to another database

changing query criteria to supply a form

find who the driver is

need total amount of items purchsed for all the persons

trim trailing spaces for name field in query

totals with where left() criteria

matched query

union query edit

   
  Privacy | Contact Us
All Times Are GMT