Re: converting data types
- From: "rocco" <rocco@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 Aug 2005 15:21:01 -0700
I have tried this:
SELECT CONTACT1.ID, CONTACT1.VISIT
FROM (SELECT ID, VISIT FROM DSPC_CONTACT WHERE VISIT IN
('10','11','12','13','14')) AS CONTACT1
WHERE Cint(CONTACT1.VISIT)>12
just to be sure to have only values that can be convertyed as numbers.
It still wont work!!!!!!!!!!!!!!!!!!!!!!
'data type mismatch in criteria expression'...AGAIN?!
"Allen Browne" wrote:
> VBA has a number of type conversion functions, such as CInt(), CDbl(),
> CLng(), CVDate().
>
> If you are expecting "integer" to be long, try:
> SELECT ID
> FROM table
> WHERE CLng([visit]) > 13
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "rocco" <rocco@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:39EB3190-3F41-49C5-916E-979ADAF2FDCB@xxxxxxxxxxxxxxxx
> > Hello,
> > i need to convert values in one column in integer dtaa type to use in SQL
> > statment.
> > it seems both CAST or CONVERT wont work in JET.
> > How can I solve my problem?
> > i have tried
> > SELECT ID
> > FROM table
> > WHERE CAST(visit as integer)>13
> >
> > But it doesn't work.
> >
> > visit is a string datatype that can have values going from 1 to 21. it is
> > the visit number of my patients (don't ask why who built the Db hasn't
> > used
> > integer data type...)
> > i want to find ID that had been visited more than 13 times.
> > How can i convert visit data-type to use the code posted above?
> >
> > i'm using Access 2003 with JET (should work also on Access 2000)
> >
> > thanks
> > Rocco
>
>
>
.
- Follow-Ups:
- Re: converting data types
- From: John Vinson
- Re: converting data types
- Prev by Date: why this wont work!!??
- Next by Date: Try to use two functions in query
- Previous by thread: why this wont work!!??
- Next by thread: Re: converting data types
- Index(es):
Relevant Pages
|