SQL data retrieval

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SQL data retrieval

Khaleel Hussaini
Hi Listers,
       Any thoughts how one would retrieve data in SPSS 15 applying a
constraint on date which is a string variable? I want to extract data for
2005 to 2006 and the variable date of discharge is a string variable.
Thanks,
KH.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: SQL data retrieval

Marks, Jim
There are substring functions in SQL that can be used.

I would use the wizard to get started on the code and edit as required

--jim

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Khaleel Hussaini
Sent: Wednesday, March 05, 2008 12:46 PM
To: [hidden email]
Subject: SQL data retrieval

Hi Listers,
       Any thoughts how one would retrieve data in SPSS 15 applying a
constraint on date which is a string variable? I want to extract data
for
2005 to 2006 and the variable date of discharge is a string variable.
Thanks,
KH.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command SIGNOFF SPSSX-L For a list
of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: SQL data retrieval

Albert-Jan Roskam
Depending on your SQL dialect it could be something
like:

SELECT var var2 var3
FROM tablename
WHERE (
SUBSTR(mydatevar, 1, 4)
IN ("2007", "2008")
)

But still, the SPSS wizard should be your starting
point for generating the CONNECT string.

Cheers!!
Albert-Jan


--- "Marks, Jim" <[hidden email]> wrote:

> There are substring functions in SQL that can be
> used.
>
> I would use the wizard to get started on the code
> and edit as required
>
> --jim
>
> -----Original Message-----
> From: SPSSX(r) Discussion
> [mailto:[hidden email]] On Behalf Of
> Khaleel Hussaini
> Sent: Wednesday, March 05, 2008 12:46 PM
> To: [hidden email]
> Subject: SQL data retrieval
>
> Hi Listers,
>        Any thoughts how one would retrieve data in
> SPSS 15 applying a
> constraint on date which is a string variable? I
> want to extract data
> for
> 2005 to 2006 and the variable date of discharge is a
> string variable.
> Thanks,
> KH.
>
> =====================
> To manage your subscription to SPSSX-L, send a
> message to
> [hidden email] (not to SPSSX-L), with no
> body text except the
> command. To leave the list, send the command SIGNOFF
> SPSSX-L For a list
> of commands to manage subscriptions, send the
> command INFO REFCARD
>
> =====================
> To manage your subscription to SPSSX-L, send a
> message to
> [hidden email] (not to SPSSX-L), with no
> body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send
> the command
> INFO REFCARD
>



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD